Skip to content

Commit

Permalink
Merge pull request #4 from thongnmtran/issue-02
Browse files Browse the repository at this point in the history
Build RCP project with Maven
  • Loading branch information
thongnmtran authored Apr 22, 2020
2 parents 8ec5eb9 + c0eb63d commit f7b7c84
Show file tree
Hide file tree
Showing 27 changed files with 637 additions and 74 deletions.
14 changes: 12 additions & 2 deletions com.kmstechnology.todolist.app/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
7 changes: 7 additions & 0 deletions com.kmstechnology.todolist.app/.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
49 changes: 10 additions & 39 deletions com.kmstechnology.todolist.app/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,16 @@ Bundle-SymbolicName: com.kmstechnology.todolist.app;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.kmstechnology.todolist.app.Activator
Bundle-Vendor: KMSTECHNOLOGY
Require-Bundle: javax.inject;bundle-version="0.0.0",
org.eclipse.swt;bundle-version="0.0.0",
org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
org.eclipse.jface;bundle-version="0.0.0",
org.eclipse.e4.ui.services;bundle-version="0.0.0",
org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
org.eclipse.e4.core.di;bundle-version="0.0.0",
org.eclipse.e4.ui.di;bundle-version="0.0.0",
org.eclipse.e4.core.contexts;bundle-version="0.0.0",
javax.inject;bundle-version="0.0.0",
org.eclipse.swt;bundle-version="0.0.0",
org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
org.eclipse.jface;bundle-version="0.0.0",
org.eclipse.e4.ui.services;bundle-version="0.0.0",
org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
org.eclipse.e4.core.di;bundle-version="0.0.0",
org.eclipse.e4.ui.di;bundle-version="0.0.0",
org.eclipse.e4.core.contexts;bundle-version="0.0.0",
javax.inject;bundle-version="0.0.0",
org.eclipse.swt;bundle-version="0.0.0",
org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
org.eclipse.jface;bundle-version="0.0.0",
org.eclipse.e4.ui.services;bundle-version="0.0.0",
org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
org.eclipse.e4.core.di;bundle-version="0.0.0",
org.eclipse.e4.ui.di;bundle-version="0.0.0",
org.eclipse.e4.core.contexts;bundle-version="0.0.0",
Require-Bundle: javax.inject,
org.eclipse.swt,
org.eclipse.e4.ui.model.workbench,
org.eclipse.jface,
org.eclipse.e4.ui.services,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.core.di,
org.eclipse.e4.ui.di,
org.eclipse.e4.core.contexts,
org.eclipse.core.runtime,
javax.inject;bundle-version="0.0.0",
org.eclipse.swt;bundle-version="0.0.0",
org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
org.eclipse.jface;bundle-version="0.0.0",
org.eclipse.e4.ui.services;bundle-version="0.0.0",
org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
org.eclipse.e4.core.di;bundle-version="0.0.0",
org.eclipse.e4.ui.di;bundle-version="0.0.0",
org.eclipse.e4.core.contexts;bundle-version="0.0.0",
org.eclipse.core.runtime;bundle-version="0.0.0"
com.kmstechnology.todolist.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.kmstechnology.todolist.core.icon,
com.kmstechnology.todolist.core.model
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="com.kmstechnology.todolist.app" id="com.kmstechnology.todolist.app.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">
<product name="com.kmstechnology.todolist.app" uid="product" id="com.kmstechnology.todolist.app.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-clearPersistedState</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
<programArgs>-clearPersistedState
</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>

<windowImages/>

<launcher name="NoteMe">
<solaris/>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="com.kmstechnology.todolist.app"/>
<plugin id="com.ibm.icu"/>
<plugin id="com.kmstechnology.todolist.app"/>
<plugin id="javax.annotation"/>
<plugin id="javax.inject"/>
<plugin id="javax.xml"/>
Expand Down Expand Up @@ -102,5 +114,19 @@
<plugin id="org.w3c.dom.svg"/>
</plugins>

<features>
<feature id="com.kmstechnology.todolist.feature" version="1.0.0.qualifier"/>
<feature id="org.eclipse.emf.common"/>
<feature id="org.eclipse.emf.ecore"/>
<feature id="org.eclipse.e4.rcp"/>
</features>

<configurations>
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

</product>
26 changes: 23 additions & 3 deletions com.kmstechnology.todolist.app/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,32 @@
name="com.kmstechnology.todolist.app"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="applicationCSS"
value="platform:/plugin/com.kmstechnology.todolist.app/css/default.css">
name="appName"
value="com.kmstechnology.todolist.app">
</property>
</product>
</extension>
<extension
id="notemercp"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.e4.ui.workbench.swt.E4Application"
name="Note Me">
<property
name="appName"
value="com.kmstechnology.todolist.app">
value="Note Me">
</property>
</product>
</extension>
<extension
id="customide"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.ui.ide.workbench"
name="Custom IDE">
<property
name="appName"
value="Custom IDE">
</property>
</product>
</extension>
Expand Down
15 changes: 15 additions & 0 deletions com.kmstechnology.todolist.app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.kmstechnology.todolist.app</artifactId>
<packaging>eclipse-plugin</packaging>
<name>Note me Application</name>

<parent>
<groupId>com.kmstechnology.todolist</groupId>
<artifactId>com.kmstechnology.todolist.pom.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.parent</relativePath>
</parent>

</project>
14 changes: 12 additions & 2 deletions com.kmstechnology.todolist.core/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
7 changes: 7 additions & 0 deletions com.kmstechnology.todolist.core/.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
6 changes: 5 additions & 1 deletion com.kmstechnology.todolist.core/build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
source.. = src/

icons/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
icons/
src.includes = icons/
13 changes: 13 additions & 0 deletions com.kmstechnology.todolist.core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.kmstechnology.todolist.core</artifactId>
<packaging>eclipse-plugin</packaging>
<name>Note me core</name>
<parent>
<groupId>com.kmstechnology.todolist</groupId>
<artifactId>com.kmstechnology.todolist.pom.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.parent</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
package com.kmstechnology.todolist.core.icon;

import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.InputStream;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

public class IconHandler {
private static Path path;
static {
try {
URL location = IconHandler.class.getProtectionDomain().getCodeSource().getLocation();
path = Paths.get(location.toURI()).resolve("../com.kmstechnology.todolist.core/icons");
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
private static final String RESOURCES_LOCATION = "/icons";

public static Image getIcon(String icon) {
String imageName = icon + ".png";
return new Image(Display.getDefault(), path.resolve(imageName).toString());
}
public static Image getIcon(String icon) {
String imageName = RESOURCES_LOCATION + "/" + icon + ".png";

InputStream resourceStream = IconHandler.class.getResourceAsStream(imageName);
return new Image(Display.getDefault(), resourceStream);
}
}
27 changes: 27 additions & 0 deletions com.kmstechnology.todolist.feature/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
13 changes: 13 additions & 0 deletions com.kmstechnology.todolist.feature/.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>
Loading

0 comments on commit f7b7c84

Please sign in to comment.