Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ This archetype will create a multi-module project with a nested structure :

__artifactId__ : parent pom project
|
|---__artifactId__.core : eclipse-plugin
|---__artifactId__.plugin : eclipse-plugin
|
|---__artifactId__.product: eclipse-repositorye
|
|---__artifactId__.feature: eclipse-feature
|
Expand Down
16 changes: 15 additions & 1 deletion src/main/resources/META-INF/maven/archetype-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<requiredProperty key="signing_support">
<defaultValue>false</defaultValue>
</requiredProperty>
<requiredProperty key="kotlin_support">
<defaultValue>false</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet encoding="UTF-8" filtered="true">
Expand All @@ -24,7 +27,7 @@
</fileSet>
</fileSets>
<modules>
<module id="${rootArtifactId}.core" dir="__rootArtifactId__.core" name="${rootArtifactId}.core">
<module id="${rootArtifactId}.plugin" dir="__rootArtifactId__.plugin" name="${rootArtifactId}.plugin">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
Expand Down Expand Up @@ -86,6 +89,17 @@
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}.product" dir="__rootArtifactId__.product" name="${rootArtifactId}.product">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory></directory>
<includes>
<include>build.properties</include>
<include>application.product</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}.site" dir="__rootArtifactId__.site" name="${rootArtifactId}.site">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/archetype-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The first run will take quite a while since maven will download all the required
In order to use the generated eclipse plugins in Eclipse, you will need m2e (https://www.eclipse.org/m2e)
and the m2eclipse-tycho plugin (https://github.com/tesla/m2eclipse-tycho/). Update sites to install these plugins :

* m2e stable update site : http://download.eclipse.org/technology/m2e/releases/
* m2e stable update site : https://download.eclipse.org/technology/m2e/releases/
* m2eclipse-tycho dev update site : http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.7.0/N/0.7.0.201309291400/

#if ($signing_support == "true" || $signing_support == "y" || $signing_support == "yes" )
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</url>

<plugin
id="${parentArtifactId}.core"
id="${parentArtifactId}.plugin"
download-size="0"
install-size="0"
version="0.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ${rootArtifactId} Core Plugin
Bundle-SymbolicName: ${rootArtifactId}.core;singleton:=true
Bundle-SymbolicName: ${rootArtifactId}.plugin;singleton:=true
Bundle-Version: ${futureVersion}.qualifier
Bundle-Activator: ${package}.core.Activator
Bundle-Activator: ${package}.plugin.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-$java_version
Automatic-Module-Name: ${rootArtifactId}.core
Automatic-Module-Name: ${rootArtifactId}.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
point="org.eclipse.ui.handlers">
<handler
commandId="command.sample.id"
class="${package}.core.SampleHandler">
#if ($kotlin_support == "true" || $kotlin_support == "y" || $kotlin_support == "yes")
class="${package}.plugin.SampleHandlerKt">
#else
#end
class="${package}.plugin.SampleHandler">
</handler>
</extension>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>${rootArtifactId}</artifactId>
<groupId>${groupId}</groupId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<packaging>eclipse-plugin</packaging>
<name>${rootArtifactId} :: core</name>
<description>${rootArtifactId} Core Plugin</description>
<properties>
#if ($kotlin_support == "true" || $kotlin_support == "y" || $kotlin_support == "yes")
<kotlin.version>1.4.32</kotlin.version>
#end
</properties>

<dependencies>
#if ($kotlin_support == "true" || $kotlin_support == "y" || $kotlin_support == "yes")
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
#end
</dependencies>

<build>
<plugins>
#if ($kotlin_support == "true" || $kotlin_support == "y" || $kotlin_support == "yes")
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>${java_version}</source>
<target>${java_version}</target>
</configuration>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<!-- Replacing default-testCompile as it is treated specially by maven -->
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>java-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
#end
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.core;
package ${package}.plugin;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Expand All @@ -13,7 +13,7 @@
public class Activator extends AbstractUIPlugin {

// The plug-in ID
public static final String PLUGIN_ID = "${parentArtifactId}.core";
public static final String PLUGIN_ID = "${parentArtifactId}.plugin";

// The shared instance
private static Activator plugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.core;
package ${package}.plugin;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.plugin;

import org.eclipse.core.commands.AbstractHandler
import org.eclipse.core.commands.ExecutionEvent
import org.eclipse.core.commands.ExecutionException
import org.eclipse.jface.dialogs.MessageDialog
import org.eclipse.ui.IWorkbench
import org.eclipse.ui.IWorkbenchWindow
import org.eclipse.ui.PlatformUI

/**
* Executed by click menu.<br></br>
*/
class SampleHandlerKt : AbstractHandler() {
private val window: IWorkbenchWindow

/**
* {@inheritDoc}
*/
@kotlin.Throws(ExecutionException::class)
fun execute(event: ExecutionEvent?): Any? {
MessageDialog.openInformation(window.getShell(), "Eclipse Plugin Archetype", "Hello, Maven+Eclipse world,\n \${parentArtifactId} is built with Tycho")
return null
}

/**
* constructor.
*/
init {
val workbench: IWorkbench = PlatformUI.getWorkbench()
window = workbench.getActiveWorkbenchWindow()
}
}
Loading