--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>maven-argeo-pde-plugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sat Dec 06 10:08:40 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+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.3
--- /dev/null
+#Fri Dec 05 10:50:52 CET 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
--- /dev/null
+<project>\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <groupId>org.argeo.slc.maven</groupId>\r
+ <artifactId>maven-argeo-pde-plugin</artifactId>\r
+ <version>0.3.1-SNAPSHOT</version>\r
+ <packaging>maven-plugin</packaging>\r
+ <name>Argeo PDE Plugin</name>\r
+\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <artifactId>maven-compiler-plugin</artifactId>\r
+ <configuration>\r
+ <source>1.4</source>\r
+ <target>1.4</target>\r
+ </configuration>\r
+ </plugin>\r
+ <plugin>\r
+ <artifactId>maven-plugin-plugin</artifactId>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.apache.maven</groupId>\r
+ <artifactId>maven-plugin-tools-ant\r
+ </artifactId>\r
+ <version>2.1</version>\r
+ </dependency>\r
+ </dependencies>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.apache.maven</groupId>\r
+ <artifactId>maven-plugin-api</artifactId>\r
+ <version>2.0</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.apache.maven</groupId>\r
+ <artifactId>maven-script-ant</artifactId>\r
+ <version>2.0.9</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.apache.maven</groupId>\r
+ <artifactId>maven-project</artifactId>\r
+ <version>2.0.7</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>ant-contrib</groupId>\r
+ <artifactId>ant-contrib</artifactId>\r
+ <version>1.0b2</version>\r
+ <exclusions>\r
+ <exclusion>\r
+ <groupId>ant</groupId>\r
+ <artifactId>ant</artifactId>\r
+ </exclusion>\r
+ </exclusions>\r
+ </dependency>\r
+ </dependencies>\r
+ <distributionManagement>\r
+ <repository>\r
+ <uniqueVersion>false</uniqueVersion>\r
+ <id>argeo-restricted</id>\r
+ <name>Argeo FOSS Repository</name>\r
+ <url>file:///var/argeo/maven2/argeo\r
+ </url>\r
+ </repository>\r
+ <snapshotRepository>\r
+ <uniqueVersion>true</uniqueVersion>\r
+ <id>argeo-snapshots-restricted</id>\r
+ <name>Argeo FOSS Snapshots Repository</name>\r
+ <url>file:///var/argeo/maven2/argeo-snapshots\r
+ </url>\r
+ </snapshotRepository>\r
+ </distributionManagement>\r
+</project>
\ No newline at end of file
--- /dev/null
+package org.argeo.slc.maven.plugins.pde;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Forks a eclipseTarget lifecycle.
+ *
+ * @goal eclipseTarget
+ * @execute lifecycle="eclipseTarget" phase="initialize"
+ */
+public class EclipseTargetMojo extends AbstractMojo {
+ public void execute() throws MojoExecutionException {
+ getLog().info("EclipseTargetMojo done");
+ }
+}
--- /dev/null
+package org.argeo.slc.maven.plugins.pde;
+
+import java.util.List;
+
+public class Feature {
+ private String providerName;
+ private String license;
+ private String copyright;
+ private List plugins;
+
+ public String getProviderName() {
+ return providerName;
+ }
+
+ public void setProviderName(String providerName) {
+ this.providerName = providerName;
+ }
+
+ public String getLicense() {
+ return license;
+ }
+
+ public void setLicense(String license) {
+ this.license = license;
+ }
+
+ public String getCopyright() {
+ return copyright;
+ }
+
+ public void setCopyright(String copyright) {
+ this.copyright = copyright;
+ }
+
+ public List getPlugins() {
+ return plugins;
+ }
+
+ public void setPlugins(List plugins) {
+ this.plugins = plugins;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.maven.plugins.pde;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+
+/**
+ * Generates a feature descripto based on the pom
+ *
+ * @goal featureDescriptor
+ * @phase process-resources
+ */
+public class FeatureDescriptorMojo extends AbstractMojo {
+ /**
+ * The Maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
+ /**
+ * The directory for the pom
+ *
+ * @parameter expression="${basedir}"
+ * @required
+ */
+ private File baseDir;
+
+ /**
+ * Information about the feature
+ *
+ * @parameter expression="${argeo-pde.feature}"
+ * @required
+ */
+ private Feature feature;
+
+ public void execute() throws MojoExecutionException {
+ File featureDesc = new File(baseDir, "feature.xml");
+ FileWriter fileWriter = null;
+ try {
+ fileWriter = new FileWriter(featureDesc);
+ PrettyPrintXMLWriter xmlWriter = new PrettyPrintXMLWriter(
+ fileWriter);
+ xmlWriter.startElement("feature");
+ xmlWriter.addAttribute("id", project.getArtifactId());
+ xmlWriter.addAttribute("label", project.getName());
+
+ String projectVersion = project.getVersion();
+ int indexSnapshot = projectVersion.indexOf("-SNAPSHOT");
+ if (indexSnapshot > -1)
+ projectVersion = projectVersion.substring(0, indexSnapshot);
+ projectVersion = projectVersion + ".qualifier";
+
+ // project.
+ xmlWriter.addAttribute("version", projectVersion);
+
+ List plugins = feature.getPlugins();
+ for (int i = 0; i < plugins.size(); i++) {
+ Plugin plugin = (Plugin) plugins.get(i);
+ xmlWriter.startElement("plugin");
+ xmlWriter.addAttribute("id", plugin.getId());
+ xmlWriter.addAttribute("version", plugin.getVersion());
+ xmlWriter.endElement();// plugin
+ }
+
+ xmlWriter.endElement();// feature
+ } catch (IOException e) {
+ throw new MojoExecutionException("Cannot write feature descriptor",
+ e);
+ }
+ IOUtil.close(fileWriter);
+ getLog().info("FeatureDescriptorMojo done");
+ }
+}
--- /dev/null
+package org.argeo.slc.maven.plugins.pde;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Builds an element and adds it as main artifact.
+ *
+ * @goal packageElement
+ * @phase package
+ * @execute goal="buildElement"
+ */
+public class PackageElementMojo extends AbstractMojo {
+ /**
+ * The Maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
+ /**
+ * The directory for the generated JAR.
+ *
+ * @parameter expression="${project.build.directory}"
+ * @required
+ */
+ private String buildDirectory;
+
+ public void execute() throws MojoExecutionException {
+ File file = new File(buildDirectory, project.getArtifactId() + ".zip");
+ project.getArtifact().setFile(file);
+ }
+}
--- /dev/null
+package org.argeo.slc.maven.plugins.pde;
+
+public class Plugin {
+ private String id;
+ private String version;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
--- /dev/null
+<lifecycles>
+ <lifecycle>
+ <id>eclipseTarget</id>
+ <phases>
+ <phase>
+ <id>initialize</id>
+ <executions>
+ <execution>
+ <goals>
+ <goal>org.apache.maven.plugins:maven-dependency-plugin:unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <useSubDirectoryPerArtifact>
+ true
+ </useSubDirectoryPerArtifact>
+ </configuration>
+ </execution>
+ <execution>
+ <goals>
+ <goal>eclipseTarget-collect</goal>
+ </goals>
+ </execution>
+ </executions>
+ </phase>
+ </phases>
+ </lifecycle>
+ <!--
+ <lifecycle>
+ <id>buildNumber</id>
+ <phases>
+ <phase>
+ <id>validate</id>
+ <executions>
+ <execution>
+ <goals>
+ <goal>org.codehaus.mojo:buildnumber-maven-plugin:create</goal>
+ </goals>
+ <configuration>
+ <buildNumberPropertyName>scmRevision</buildNumberPropertyName>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ </configuration>
+ </execution>
+ </executions>
+ </phase>
+ </phases>
+ </lifecycle>
+ -->
+</lifecycles>
--- /dev/null
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.lifecycle.mapping.LifecycleMapping
+ </role>
+ <role-hint>eclipseFeature</role-hint>
+ <implementation>
+ org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
+ </implementation>
+ <configuration>
+ <lifecycles>
+ <lifecycle>
+ <id>default</id>
+ <phases>
+ <initialize>
+ org.argeo.slc.maven:maven-argeo-pde-plugin:eclipseTarget
+ </initialize>
+ <process-resources>
+ org.argeo.slc.maven:maven-argeo-pde-plugin:featureDescriptor
+ </process-resources>
+ <package>
+ org.argeo.slc.maven:maven-argeo-pde-plugin:packageElement
+ </package>
+ <install>
+ org.apache.maven.plugins:maven-install-plugin:install
+ </install>
+ <deploy>
+ org.apache.maven.plugins:maven-deploy-plugin:deploy
+ </deploy>
+ </phases>
+ </lifecycle>
+ </lifecycles>
+ </configuration>
+ </component>
+ <component>
+ <role>org.apache.maven.artifact.handler.ArtifactHandler
+ </role>
+ <role-hint>eclipseFeature</role-hint>
+ <implementation>
+ org.apache.maven.artifact.handler.DefaultArtifactHandler
+ </implementation>
+ <configuration>
+ <type>eclipseFeature</type>
+ <includesDependencies>false</includesDependencies>
+ <language>java</language>
+ <extension>zip</extension>
+ <addedToClasspath>false</addedToClasspath>
+ </configuration>
+ </component>
+ </components>
+</component-set>
--- /dev/null
+<project>
+ <!--
+ Defaults
+ -->
+
+ <!-- Maven project basedir -->
+ <property name="projectDirectory" location="${basedir}" />
+ <!-- Maven build dir -->
+ <property name="project.build.directory" location="${projectDirectory}/target" />
+ <!-- Maven dependency plugin dir -->
+ <property name="dependencyDir" location="${project.build.directory}/dependency" />
+ <!-- Arguments passed to Eclipse ant -->
+ <property name="eclipseAntArgs" value="" />
+ <!-- Additional arguments passed to Eclipse build script -->
+ <property name="buildScriptProperties" value="" />
+
+ <!--
+ Argeo PDE folders
+ -->
+ <!-- Argeo PDE plugin dir -->
+ <property name="argeo-pde.dir" location="${project.build.directory}/argeo-pde" />
+ <!-- Temporary folder used by Eclipse build -->
+ <property name="buildTempFolder" location="${argeo-pde.dir}/temp" />
+ <!-- Eclipse Builder -->
+ <!--<property name="pdeBuilder" location="${argeo-pde.dir}/pdeBuilder" />-->
+
+ <!-- Eclipse Target -->
+ <property name="eclipseTarget" location="${argeo-pde.dir}/eclipseTarget" />
+ <property name="pdeBuilder" location="${eclipseTarget}" />
+
+ <!-- TODO: remove this since we build only features? -->
+ <available file="${projectDirectory}/plugin.xml" property="elementType" value="plugin" />
+ <available file="${projectDirectory}/feature.xml" property="elementType" value="feature" />
+
+ <!-- Destination dirs -->
+ <property name="argeo-pde.destinationDir" location="${argeo-pde.dir}/destination" />
+ <property name="pluginDestination" location="${argeo-pde.destinationDir}/plugins" />
+ <property name="featureDestination" location="${argeo-pde.destinationDir}/features" />
+
+ <!-- Source dirs -->
+ <property name="argeo-pde.sourceDir" location="${argeo-pde.dir}/source" />
+ <property name="buildDirectory" location="${argeo-pde.sourceDir}" />
+
+
+ <!-- TODO: make it more generic. Site file template -->
+ <property name="siteTemplate" location="${projectDirectory}/site.template" />
+
+ <!-- TODO: put it under argeo-pde. Product build properties -->
+ <property name="buildConfiguration" value="buildConfiguration" />
+ <property name="buildConfiguration.dir" location="${projectDirectory}/${buildConfiguration}" />
+
+
+
+ <!--
+ Element build properties
+ -->
+
+ <!--
+ TARGET Build Element
+ -->
+ <target name="buildElement" depends="init" description="Builds an element (plugin or feature)">
+ <fail message="Property buildScriptTargets has to be set" unless="buildScriptTargets" />
+
+ <mkdir dir="${pluginDestination}" />
+ <mkdir dir="${featureDestination}" />
+
+ <!-- Copy to source -->
+ <property name="sourceBaseDir" location="${projectDirectory}/../.." />
+ <copy todir="${argeo-pde.sourceDir}">
+ <fileset dir="${sourceBaseDir}">
+ <include name="plugins/**" />
+ <include name="features/**" />
+ <exclude name="**/target/**" />
+ <exclude name="**/.svn/**" />
+ </fileset>
+ </copy>
+
+ <property name="elementBuildScript" location="${buildDirectory}/${elementType}s/${elementId}/build.xml" />
+
+ <eclipseAnt antfile="${ant.file}" antargs="eclipse.generateScripts -DpdeBuilder=${pdeBuilder} -DpluginPath=${dependencyDir} -DprojectDirectory=${projectDirectory} -DeclipseBuildDir=${eclipseBuildDir} -DelementId=${elementId} -DbuildDirectory=${buildDirectory}" />
+ <eclipseAnt antfile="${elementBuildScript}" antargs="${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder -DjavacFailOnError=true ${buildScriptProperties}" />
+
+ <copy todir="${project.build.directory}">
+ <fileset dir="${featureDestination}">
+ <include name="*.zip" />
+ </fileset>
+ <mergemapper to="${elementId}.zip" />
+ </copy>
+
+ <!-- TODO Update site
+ <copy tofile="${project.build.directory}/site.xml" file="${siteTemplate}">
+ <filterset begintoken="$${" endtoken="}">
+ <filtersfile file="${buildDirectory}/finalFeaturesVersions.properties" />
+ </filterset>
+ </copy>
+ <zip destfile="${project.build.directory}/${elementId}-updatesite.zip">
+ <fileset dir="${project.build.directory}">
+ <include name="plugins/*.jar" />
+ <include name="features/*.jar" />
+ <include name="site.xml" />
+ </fileset>
+ </zip>
+ -->
+ </target>
+
+ <!--
+ TARGET Build Product
+ -->
+ <target name="buildProduct" depends="init" description="Builds a product">
+ <!-- Load provided build.properties to leave a chance to override -->
+ <property file="${buildConfiguration.dir}/build.properties" />
+ <!-- Set default properties -->
+ <property name="archivePrefix" value="${elementId}" />
+ <property name="buildId" value="${archivePrefix}" />
+ <property name="buildLabel" value="${archivePrefix}" />
+ <property name="collectingFolder" value="${archivePrefix}" />
+ <property name="skipFetch" value="true" />
+ <property name="skipMaps" value="true" />
+ <property name="runPackager" value="true" />
+
+ <!-- Find PDE build file -->
+ <pathconvert pathsep="" property="productBuildFile">
+ <path>
+ <fileset dir="${pdeBuilder}/plugins">
+ <include name="org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
+ </fileset>
+ </path>
+ </pathconvert>
+ <echo message="productBuildFile=${productBuildFile}" />
+
+ <!-- Copy sources -->
+ <property name="buildDirectory" location="${project.build.directory}/productBuild" />
+ <mkdir dir="${buildDirectory}" />
+ <copy todir="${buildDirectory}" includeemptydirs="true" verbose="true">
+ <fileset dir="${projectDirectory}/../..">
+ <include name="plugins/**" />
+ <include name="features/**" />
+ <exclude name="**/.svn/**" />
+ <exclude name="**/target/**" />
+ </fileset>
+ </copy>
+
+ <!-- Execute -->
+ <eclipseAnt antfile="${productBuildFile}" antargs="-Dbuilder=${buildConfiguration.dir} -DbuildDirectory=${buildDirectory} -DbaseLocation=${eclipseTarget} -Dbase=${base} -DpluginPath=${dependencyDir} -DarchivePrefix=${archivePrefix} -DbuildLabel=${buildLabel} -DbuildId=${buildId} -DcollectingFolder=${collectingFolder} -DskipFetch=${skipFetch} -DskipMaps=${skipMaps} -DrunPackager=${runPackager}" />
+
+ <!-- Copy to target dir -->
+ <copy todir="${project.build.directory}">
+ <fileset dir="${buildDirectory}/${collectingFolder}">
+ <include name="*.zip" />
+ </fileset>
+ <globmapper from="${archivePrefix}-*" to="${elementId}-*" />
+ </copy>
+ </target>
+
+ <!--
+ TARGET eclipseTarget-collect
+ -->
+ <target name="eclipseTarget-collect" description="Creates an Eclipse target location based on the dependencies">
+ <taskdef resource="net/sf/antcontrib/antlib.xml" />
+ <for param="dir">
+ <dirset dir="${project.build.directory}/dependency">
+ <include name="*" />
+ </dirset>
+ <sequential>
+ <copy todir="${eclipseTarget}" failonerror="false">
+ <fileset dir="@{dir}">
+ <include name="plugins/**" />
+ <include name="features/**" />
+ </fileset>
+ </copy>
+ <copy todir="${eclipseTarget}" failonerror="false">
+ <fileset dir="@{dir}/eclipse">
+ <include name="plugins/**" />
+ <include name="features/**" />
+ </fileset>
+ </copy>
+ </sequential>
+ </for>
+
+ <!-- Copy configuration from SDK -->
+ <for param="dir">
+ <dirset dir="${project.build.directory}/dependency">
+ <include name="eclipse-sdk-*" />
+ </dirset>
+ <sequential>
+ <copy todir="${eclipseTarget}" failonerror="false">
+ <fileset dir="@{dir}/eclipse">
+ <include name="configuration/**" />
+ </fileset>
+ </copy>
+ </sequential>
+ </for>
+ </target>
+
+ <!--
+ COMMON UTILITIES
+ -->
+ <target name="init">
+ <path id="pdeBuilder.launcher.classpath">
+ <fileset dir="${pdeBuilder}/plugins">
+ <include name="org.eclipse.equinox.launcher_*.jar" />
+ </fileset>
+ </path>
+
+ <!-- Log properties -->
+ <echo message="basedir=${basedir}" />
+ <echo message="ant.file=${ant.file}" />
+ <echo message="projectDirectory=${projectDirectory}" />
+
+ <echo message="pdeBuilder=${pdeBuilder}" />
+ <echo message="eclipseTarget=${eclipseTarget}" />
+
+ <echo message="elementType=${elementType}" />
+ <echo message="elementId=${elementId}" />
+ <echo message="elementBuildScript=${elementBuildScript}" />
+ <echo message="buildScriptTargets=${buildScriptTargets}" />
+ <echo message="buildScriptProperties=${buildScriptProperties}" />
+
+ <echo message="eclipseAntArgs=${eclipseAntArgs}" />
+
+ <echo message="buildConfiguration.dir=${buildConfiguration.dir}" />
+ </target>
+ <!--
+ <target name="setPluginPath">
+ <mkdir dir="${dependencyDir}" />
+ <pathconvert property="pluginPath">
+ <path>
+ <pathelement location="${dependencyDir}" />
+ <dirset dir="${pluginPathBase}">
+ <include name="*" />
+ </dirset>
+ </path>
+ </pathconvert>
+ <echo message="pluginPath=${pluginPath}" />
+ </target>
+-->
+ <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
+ <target name="eclipse.generateScripts" depends="init">
+ <fail message="Property elementType has to be set" unless="elementType" />
+ <eclipse.buildScript elements="${elementType}@${elementId}" buildDirectory="${buildDirectory}" baseLocation="${eclipseTarget}" outputUpdateJars="true" generateVersionsLists="true" pluginPath="${dependencyDir}" />
+ </target>
+
+ <!-- MACRODEFS -->
+ <macrodef name="eclipseAnt">
+ <attribute name="antfile" />
+ <attribute name="antargs" />
+ <sequential>
+ <echo message="Call Eclipse Ant for file @{antfile} with args ${eclipseAntArgs} @{antargs}" />
+ <java fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
+ <classpath refid="pdeBuilder.launcher.classpath" />
+ <arg line="-data ${argeo-pde.dir}/workspace" />
+ <arg line="-application org.eclipse.ant.core.antRunner" />
+ <arg line="-buildfile @{antfile}" />
+ <arg line="${eclipseAntArgs}" />
+ <arg line="@{antargs}" />
+ </java>
+ </sequential>
+ </macrodef>
+</project>
\ No newline at end of file
--- /dev/null
+<pluginMetadata>
+ <mojos>
+ <mojo>
+ <goal>buildElement</goal>
+ <call>buildElement</call>
+ <description>
+ Builds an element (plugin or feature)
+ </description>
+
+ <requiresProject>true</requiresProject>
+
+ <parameters>
+ <!-- Common -->
+ <parameter>
+ <name>eclipseAntArgs</name>
+ <property>eclipseAntArgs</property>
+ <expression>${eclipseAntArgs}</expression>
+ <defaultValue></defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ Additional args passed to Eclipse Ant (such as
+ verbose/debug level)
+ </description>
+ </parameter>
+ <parameter>
+ <name>elementId</name>
+ <property>elementId</property>
+ <required>true</required>
+ <defaultValue>${project.artifactId}
+ </defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The artifact id of the project by default, will
+ be used
+ as element id.
+ </description>
+ </parameter>
+ <!-- Specific -->
+ <parameter>
+ <name>buildScriptTargets</name>
+ <property>buildScriptTargets</property>
+ <required>true</required>
+ <expression>${buildScriptTargets}</expression>
+ <defaultValue>
+ build.update.jar zip.distribution
+ </defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The targets to execute in the generated build
+ script
+ </description>
+ </parameter>
+ <parameter>
+ <name>buildScriptProperties</name>
+ <property>buildScriptProperties</property>
+ <required>true</required>
+ <expression>${buildScriptProperties}
+ </expression>
+ <defaultValue></defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The properties to pass to the generated build
+ script
+ </description>
+ </parameter>
+ </parameters>
+ </mojo>
+
+
+ <mojo>
+ <goal>buildProduct</goal>
+ <call>buildProduct</call>
+ <description>Builds a product</description>
+
+ <requiresProject>true</requiresProject>
+
+ <parameters>
+ <!-- Common -->
+ <!-- TODO: remove -->
+ <parameter>
+ <name>eclipseBuildDir</name>
+ <property>eclipseBuildDir</property>
+ <required>true</required>
+ <expression>${eclipseBuildDir}</expression>
+ <type>java.lang.String</type>
+ <description>
+ The Eclipse build dir location
+ </description>
+ </parameter>
+ <parameter>
+ <name>eclipseAntArgs</name>
+ <property>eclipseAntArgs</property>
+ <expression>${eclipseAntArgs}</expression>
+ <defaultValue></defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ Additional args passed to Eclipse Ant (such as
+ verbose/debug level)
+ </description>
+ </parameter>
+ <parameter>
+ <name>elementId</name>
+ <property>elementId</property>
+ <required>true</required>
+ <defaultValue>${project.artifactId}
+ </defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The artifact id of the project by default, will
+ be used
+ as element id.
+ </description>
+ </parameter>
+ <!-- Specific -->
+ <parameter>
+ <name>buildConfiguration</name>
+ <property>buildConfiguration</property>
+ <required>true</required>
+ <defaultValue>buildConfiguration</defaultValue>
+ <expression>${buildConfiguration}</expression>
+ <type>java.lang.String</type>
+ <description>
+ Relative path to the product build directory
+ </description>
+ </parameter>
+ </parameters>
+ </mojo>
+
+
+ <mojo>
+ <goal>clean</goal>
+ <call>clean</call>
+ <description>Clean generated artifacts</description>
+ <requiresProject>true</requiresProject>
+
+ <parameters>
+ <parameter>
+ <name>elementId</name>
+ <property>elementId</property>
+ <required>true</required>
+ <readonly>true</readonly>
+ <defaultValue>${project.artifactId}
+ </defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The artifact id of the project by default, will
+ be used
+ as element id.
+ </description>
+ </parameter>
+ </parameters>
+ </mojo>
+
+ <mojo>
+ <goal>eclipseTarget-collect</goal>
+ <call>eclipseTarget-collect</call>
+ <description>
+ Installs an Eclipse target based on dependencies
+ </description>
+ <requiresProject>true</requiresProject>
+ </mojo>
+ </mojos>
+</pluginMetadata>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>argeo.slc.testfeature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+bin.includes = feature.xml
--- /dev/null
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.argeo.slc.sandbox</groupId>
+ <artifactId>argeo.slc.testfeature</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <packaging>eclipseFeature</packaging>
+ <name>Argeo SLC Test Eclipse Feature</name>
+ <scm>
+ <developerConnection>
+ scm:svn:https://www.argeo.org/svn/slc/trunk/maven/plugins/maven-argeo-pde-plugin/src/test/eclipse/features/argeo.slc.testfeature
+ </developerConnection>
+ </scm>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.argeo.slc.maven</groupId>
+ <artifactId>maven-argeo-pde-plugin</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ <extensions>true</extensions>
+ <configuration>
+ <buildScriptProperties><![CDATA[-DjavacSource=1.5 -DjavacTarget=1.5]]></buildScriptProperties>
+ <feature>
+ <plugins>
+ <plugin>
+ <id>argeo.slc.testplugin</id>
+ <version>1.0.0.qualifier</version>
+ </plugin>
+ </plugins>
+ </feature>
+ </configuration>
+ </plugin>
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>getScmRevision</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ <configuration>
+ <buildNumberPropertyName>scmRevision</buildNumberPropertyName>
+ <doCheck>false</doCheck>
+ <doUpdate>true</doUpdate>
+ </configuration>
+ </execution>
+ <execution> <id>getTimestamp</id> <phase>initialize</phase>
+ <goals> <goal>create</goal> </goals> <configuration>
+ <format>{0}_{1,date,yyyyMMddHHmmss}</format> <items>
+ <item>${scmRevision}</item> <item>timestamp</item> </items>
+ </configuration> </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>true</doUpdate>
+ </configuration>
+ </plugin>
+ -->
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- Eclipse Base -->
+ <dependency>
+ <groupId>org.argeo.dep.dist</groupId>
+ <artifactId>eclipse-sdk-linux-gtk</artifactId>
+ <version>3.4.1</version>
+ <type>tar.gz</type>
+ <classifier>dist</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.dep.dist</groupId>
+ <artifactId>eclipse-rcp-deltapack</artifactId>
+ <version>3.4.1</version>
+ <type>zip</type>
+ <classifier>dist</classifier>
+ </dependency>
+ </dependencies>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>argeo-plugins</id>
+ <url>http://www.argeo.org/maven/argeo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <feature url="features/org.argeo.slc.ui.launch.feature_${org.argeo.slc.ui.launch.feature}.jar" id="org.argeo.slc.ui.launch.feature" version="${org.argeo.slc.ui.launch.feature}">
+ <category name="argeo.slc.ui"/>
+ </feature>
+ <category-def name="argeo.slc.ui" label="Argeo SLC UI">
+ <description>
+ UI extensions used to simplify development based on Argeo SLC.
+ </description>
+ </category-def>
+</site>
--- /dev/null
+<?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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>argeo.slc.testplugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Dec 05 11:33:10 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Testplugin Plug-in
+Bundle-SymbolicName: argeo.slc.testplugin; singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: argeo.slc.testplugin.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
--- /dev/null
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ contexts.xml
--- /dev/null
+<contexts>
+ <context id="viewer" title="Sample View">
+ <description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
+ <topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
+ <enablement>
+ <with variable="platform">
+ <test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
+ </with>
+ </enablement>
+ </topic>
+ </context>
+</contexts>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="Sample Category"
+ id="argeo.slc.testplugin">
+ </category>
+ <view
+ name="Sample View"
+ icon="icons/sample.gif"
+ category="argeo.slc.testplugin"
+ class="argeo.slc.testplugin.views.SampleView"
+ id="argeo.slc.testplugin.views.SampleView">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <view
+ ratio="0.5"
+ relative="org.eclipse.ui.views.TaskList"
+ relationship="right"
+ id="argeo.slc.testplugin.views.SampleView">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+</plugin>
--- /dev/null
+package argeo.slc.testplugin;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "argeo.slc.testplugin";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
--- /dev/null
+package argeo.slc.testplugin.views;
+
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.*;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.SWT;
+
+
+/**
+ * This sample class demonstrates how to plug-in a new
+ * workbench view. The view shows data obtained from the
+ * model. The sample creates a dummy model on the fly,
+ * but a real implementation would connect to the model
+ * available either in this or another plug-in (e.g. the workspace).
+ * The view is connected to the model using a content provider.
+ * <p>
+ * The view uses a label provider to define how model
+ * objects should be presented in the view. Each
+ * view can present the same model objects using
+ * different labels and icons, if needed. Alternatively,
+ * a single label provider can be shared between views
+ * in order to ensure that objects of the same type are
+ * presented in the same way everywhere.
+ * <p>
+ */
+
+public class SampleView extends ViewPart {
+ private TableViewer viewer;
+ private Action action1;
+ private Action action2;
+ private Action doubleClickAction;
+
+ /*
+ * The content provider class is responsible for
+ * providing objects to the view. It can wrap
+ * existing objects in adapters or simply return
+ * objects as-is. These objects may be sensitive
+ * to the current input of the view, or ignore
+ * it and always show the same content
+ * (like Task List, for example).
+ */
+
+ class ViewContentProvider implements IStructuredContentProvider {
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+ public void dispose() {
+ }
+ public Object[] getElements(Object parent) {
+ return new String[] { "One", "Two", "Three" };
+ }
+ }
+ class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
+ public String getColumnText(Object obj, int index) {
+ return getText(obj);
+ }
+ public Image getColumnImage(Object obj, int index) {
+ return getImage(obj);
+ }
+ public Image getImage(Object obj) {
+ return PlatformUI.getWorkbench().
+ getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+ }
+ }
+ class NameSorter extends ViewerSorter {
+ }
+
+ /**
+ * The constructor.
+ */
+ public SampleView() {
+ }
+
+ /**
+ * This is a callback that will allow us
+ * to create the viewer and initialize it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(new ViewContentProvider());
+ viewer.setLabelProvider(new ViewLabelProvider());
+ viewer.setSorter(new NameSorter());
+ viewer.setInput(getViewSite());
+
+ // Create the help context id for the viewer's control
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "argeo.slc.testplugin.viewer");
+ makeActions();
+ hookContextMenu();
+ hookDoubleClickAction();
+ contributeToActionBars();
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu");
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ SampleView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(action1);
+ manager.add(new Separator());
+ manager.add(action2);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(action1);
+ manager.add(action2);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(action1);
+ manager.add(action2);
+ }
+
+ private void makeActions() {
+ action1 = new Action() {
+ public void run() {
+ showMessage("Action 1 executed");
+ }
+ };
+ action1.setText("Action 1");
+ action1.setToolTipText("Action 1 tooltip");
+ action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+
+ action2 = new Action() {
+ public void run() {
+ showMessage("Action 2 executed");
+ }
+ };
+ action2.setText("Action 2");
+ action2.setToolTipText("Action 2 tooltip");
+ action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+ doubleClickAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ Object obj = ((IStructuredSelection)selection).getFirstElement();
+ showMessage("Double-click detected on "+obj.toString());
+ }
+ };
+ }
+
+ private void hookDoubleClickAction() {
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ doubleClickAction.run();
+ }
+ });
+ }
+ private void showMessage(String message) {
+ MessageDialog.openInformation(
+ viewer.getControl().getShell(),
+ "Sample View",
+ message);
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>maven-argeo-pde-plugin</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sat Dec 06 10:08:40 CET 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-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.3
+++ /dev/null
-#Fri Dec 05 10:50:52 CET 2008
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-version=1
+++ /dev/null
-<project>\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.argeo.slc.maven</groupId>\r
- <artifactId>maven-argeo-pde-plugin</artifactId>\r
- <version>0.3.1-SNAPSHOT</version>\r
- <packaging>maven-plugin</packaging>\r
- <name>Argeo PDE Plugin</name>\r
-\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <artifactId>maven-compiler-plugin</artifactId>\r
- <configuration>\r
- <source>1.4</source>\r
- <target>1.4</target>\r
- </configuration>\r
- </plugin>\r
- <plugin>\r
- <artifactId>maven-plugin-plugin</artifactId>\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.apache.maven</groupId>\r
- <artifactId>maven-plugin-tools-ant\r
- </artifactId>\r
- <version>2.1</version>\r
- </dependency>\r
- </dependencies>\r
- </plugin>\r
- </plugins>\r
- </build>\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.apache.maven</groupId>\r
- <artifactId>maven-plugin-api</artifactId>\r
- <version>2.0</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.apache.maven</groupId>\r
- <artifactId>maven-script-ant</artifactId>\r
- <version>2.0.9</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.apache.maven</groupId>\r
- <artifactId>maven-project</artifactId>\r
- <version>2.0.7</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>ant-contrib</groupId>\r
- <artifactId>ant-contrib</artifactId>\r
- <version>1.0b2</version>\r
- <exclusions>\r
- <exclusion>\r
- <groupId>ant</groupId>\r
- <artifactId>ant</artifactId>\r
- </exclusion>\r
- </exclusions>\r
- </dependency>\r
- </dependencies>\r
- <distributionManagement>\r
- <repository>\r
- <uniqueVersion>false</uniqueVersion>\r
- <id>argeo-restricted</id>\r
- <name>Argeo FOSS Repository</name>\r
- <url>file:///var/argeo/maven2/argeo\r
- </url>\r
- </repository>\r
- <snapshotRepository>\r
- <uniqueVersion>true</uniqueVersion>\r
- <id>argeo-snapshots-restricted</id>\r
- <name>Argeo FOSS Snapshots Repository</name>\r
- <url>file:///var/argeo/maven2/argeo-snapshots\r
- </url>\r
- </snapshotRepository>\r
- </distributionManagement>\r
-</project>
\ No newline at end of file
+++ /dev/null
-package org.argeo.slc.maven.plugins.pde;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-
-/**
- * Forks a eclipseTarget lifecycle.
- *
- * @goal eclipseTarget
- * @execute lifecycle="eclipseTarget" phase="initialize"
- */
-public class EclipseTargetMojo extends AbstractMojo {
- public void execute() throws MojoExecutionException {
- getLog().info("EclipseTargetMojo done");
- }
-}
+++ /dev/null
-package org.argeo.slc.maven.plugins.pde;
-
-import java.util.List;
-
-public class Feature {
- private String providerName;
- private String license;
- private String copyright;
- private List plugins;
-
- public String getProviderName() {
- return providerName;
- }
-
- public void setProviderName(String providerName) {
- this.providerName = providerName;
- }
-
- public String getLicense() {
- return license;
- }
-
- public void setLicense(String license) {
- this.license = license;
- }
-
- public String getCopyright() {
- return copyright;
- }
-
- public void setCopyright(String copyright) {
- this.copyright = copyright;
- }
-
- public List getPlugins() {
- return plugins;
- }
-
- public void setPlugins(List plugins) {
- this.plugins = plugins;
- }
-
-}
+++ /dev/null
-package org.argeo.slc.maven.plugins.pde;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-
-/**
- * Generates a feature descripto based on the pom
- *
- * @goal featureDescriptor
- * @phase process-resources
- */
-public class FeatureDescriptorMojo extends AbstractMojo {
- /**
- * The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * The directory for the pom
- *
- * @parameter expression="${basedir}"
- * @required
- */
- private File baseDir;
-
- /**
- * Information about the feature
- *
- * @parameter expression="${argeo-pde.feature}"
- * @required
- */
- private Feature feature;
-
- public void execute() throws MojoExecutionException {
- File featureDesc = new File(baseDir, "feature.xml");
- FileWriter fileWriter = null;
- try {
- fileWriter = new FileWriter(featureDesc);
- PrettyPrintXMLWriter xmlWriter = new PrettyPrintXMLWriter(
- fileWriter);
- xmlWriter.startElement("feature");
- xmlWriter.addAttribute("id", project.getArtifactId());
- xmlWriter.addAttribute("label", project.getName());
-
- String projectVersion = project.getVersion();
- int indexSnapshot = projectVersion.indexOf("-SNAPSHOT");
- if (indexSnapshot > -1)
- projectVersion = projectVersion.substring(0, indexSnapshot);
- projectVersion = projectVersion + ".qualifier";
-
- // project.
- xmlWriter.addAttribute("version", projectVersion);
-
- List plugins = feature.getPlugins();
- for (int i = 0; i < plugins.size(); i++) {
- Plugin plugin = (Plugin) plugins.get(i);
- xmlWriter.startElement("plugin");
- xmlWriter.addAttribute("id", plugin.getId());
- xmlWriter.addAttribute("version", plugin.getVersion());
- xmlWriter.endElement();// plugin
- }
-
- xmlWriter.endElement();// feature
- } catch (IOException e) {
- throw new MojoExecutionException("Cannot write feature descriptor",
- e);
- }
- IOUtil.close(fileWriter);
- getLog().info("FeatureDescriptorMojo done");
- }
-}
+++ /dev/null
-package org.argeo.slc.maven.plugins.pde;
-
-import java.io.File;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-
-/**
- * Builds an element and adds it as main artifact.
- *
- * @goal packageElement
- * @phase package
- * @execute goal="buildElement"
- */
-public class PackageElementMojo extends AbstractMojo {
- /**
- * The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * The directory for the generated JAR.
- *
- * @parameter expression="${project.build.directory}"
- * @required
- */
- private String buildDirectory;
-
- public void execute() throws MojoExecutionException {
- File file = new File(buildDirectory, project.getArtifactId() + ".zip");
- project.getArtifact().setFile(file);
- }
-}
+++ /dev/null
-package org.argeo.slc.maven.plugins.pde;
-
-public class Plugin {
- private String id;
- private String version;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
-}
+++ /dev/null
-<lifecycles>
- <lifecycle>
- <id>eclipseTarget</id>
- <phases>
- <phase>
- <id>initialize</id>
- <executions>
- <execution>
- <goals>
- <goal>org.apache.maven.plugins:maven-dependency-plugin:unpack-dependencies</goal>
- </goals>
- <configuration>
- <useSubDirectoryPerArtifact>
- true
- </useSubDirectoryPerArtifact>
- </configuration>
- </execution>
- <execution>
- <goals>
- <goal>eclipseTarget-collect</goal>
- </goals>
- </execution>
- </executions>
- </phase>
- </phases>
- </lifecycle>
- <!--
- <lifecycle>
- <id>buildNumber</id>
- <phases>
- <phase>
- <id>validate</id>
- <executions>
- <execution>
- <goals>
- <goal>org.codehaus.mojo:buildnumber-maven-plugin:create</goal>
- </goals>
- <configuration>
- <buildNumberPropertyName>scmRevision</buildNumberPropertyName>
- <doCheck>false</doCheck>
- <doUpdate>false</doUpdate>
- </configuration>
- </execution>
- </executions>
- </phase>
- </phases>
- </lifecycle>
- -->
-</lifecycles>
+++ /dev/null
-<component-set>
- <components>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping
- </role>
- <role-hint>eclipseFeature</role-hint>
- <implementation>
- org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
- </implementation>
- <configuration>
- <lifecycles>
- <lifecycle>
- <id>default</id>
- <phases>
- <initialize>
- org.argeo.slc.maven:maven-argeo-pde-plugin:eclipseTarget
- </initialize>
- <process-resources>
- org.argeo.slc.maven:maven-argeo-pde-plugin:featureDescriptor
- </process-resources>
- <package>
- org.argeo.slc.maven:maven-argeo-pde-plugin:packageElement
- </package>
- <install>
- org.apache.maven.plugins:maven-install-plugin:install
- </install>
- <deploy>
- org.apache.maven.plugins:maven-deploy-plugin:deploy
- </deploy>
- </phases>
- </lifecycle>
- </lifecycles>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler
- </role>
- <role-hint>eclipseFeature</role-hint>
- <implementation>
- org.apache.maven.artifact.handler.DefaultArtifactHandler
- </implementation>
- <configuration>
- <type>eclipseFeature</type>
- <includesDependencies>false</includesDependencies>
- <language>java</language>
- <extension>zip</extension>
- <addedToClasspath>false</addedToClasspath>
- </configuration>
- </component>
- </components>
-</component-set>
+++ /dev/null
-<project>
- <!--
- Defaults
- -->
-
- <!-- Maven project basedir -->
- <property name="projectDirectory" location="${basedir}" />
- <!-- Maven build dir -->
- <property name="project.build.directory" location="${projectDirectory}/target" />
- <!-- Maven dependency plugin dir -->
- <property name="dependencyDir" location="${project.build.directory}/dependency" />
- <!-- Arguments passed to Eclipse ant -->
- <property name="eclipseAntArgs" value="" />
- <!-- Additional arguments passed to Eclipse build script -->
- <property name="buildScriptProperties" value="" />
-
- <!--
- Argeo PDE folders
- -->
- <!-- Argeo PDE plugin dir -->
- <property name="argeo-pde.dir" location="${project.build.directory}/argeo-pde" />
- <!-- Temporary folder used by Eclipse build -->
- <property name="buildTempFolder" location="${argeo-pde.dir}/temp" />
- <!-- Eclipse Builder -->
- <!--<property name="pdeBuilder" location="${argeo-pde.dir}/pdeBuilder" />-->
-
- <!-- Eclipse Target -->
- <property name="eclipseTarget" location="${argeo-pde.dir}/eclipseTarget" />
- <property name="pdeBuilder" location="${eclipseTarget}" />
-
- <!-- TODO: remove this since we build only features? -->
- <available file="${projectDirectory}/plugin.xml" property="elementType" value="plugin" />
- <available file="${projectDirectory}/feature.xml" property="elementType" value="feature" />
-
- <!-- Destination dirs -->
- <property name="argeo-pde.destinationDir" location="${argeo-pde.dir}/destination" />
- <property name="pluginDestination" location="${argeo-pde.destinationDir}/plugins" />
- <property name="featureDestination" location="${argeo-pde.destinationDir}/features" />
-
- <!-- Source dirs -->
- <property name="argeo-pde.sourceDir" location="${argeo-pde.dir}/source" />
- <property name="buildDirectory" location="${argeo-pde.sourceDir}" />
-
-
- <!-- TODO: make it more generic. Site file template -->
- <property name="siteTemplate" location="${projectDirectory}/site.template" />
-
- <!-- TODO: put it under argeo-pde. Product build properties -->
- <property name="buildConfiguration" value="buildConfiguration" />
- <property name="buildConfiguration.dir" location="${projectDirectory}/${buildConfiguration}" />
-
-
-
- <!--
- Element build properties
- -->
-
- <!--
- TARGET Build Element
- -->
- <target name="buildElement" depends="init" description="Builds an element (plugin or feature)">
- <fail message="Property buildScriptTargets has to be set" unless="buildScriptTargets" />
-
- <mkdir dir="${pluginDestination}" />
- <mkdir dir="${featureDestination}" />
-
- <!-- Copy to source -->
- <property name="sourceBaseDir" location="${projectDirectory}/../.." />
- <copy todir="${argeo-pde.sourceDir}">
- <fileset dir="${sourceBaseDir}">
- <include name="plugins/**" />
- <include name="features/**" />
- <exclude name="**/target/**" />
- <exclude name="**/.svn/**" />
- </fileset>
- </copy>
-
- <property name="elementBuildScript" location="${buildDirectory}/${elementType}s/${elementId}/build.xml" />
-
- <eclipseAnt antfile="${ant.file}" antargs="eclipse.generateScripts -DpdeBuilder=${pdeBuilder} -DpluginPath=${dependencyDir} -DprojectDirectory=${projectDirectory} -DeclipseBuildDir=${eclipseBuildDir} -DelementId=${elementId} -DbuildDirectory=${buildDirectory}" />
- <eclipseAnt antfile="${elementBuildScript}" antargs="${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder -DjavacFailOnError=true ${buildScriptProperties}" />
-
- <copy todir="${project.build.directory}">
- <fileset dir="${featureDestination}">
- <include name="*.zip" />
- </fileset>
- <mergemapper to="${elementId}.zip" />
- </copy>
-
- <!-- TODO Update site
- <copy tofile="${project.build.directory}/site.xml" file="${siteTemplate}">
- <filterset begintoken="$${" endtoken="}">
- <filtersfile file="${buildDirectory}/finalFeaturesVersions.properties" />
- </filterset>
- </copy>
- <zip destfile="${project.build.directory}/${elementId}-updatesite.zip">
- <fileset dir="${project.build.directory}">
- <include name="plugins/*.jar" />
- <include name="features/*.jar" />
- <include name="site.xml" />
- </fileset>
- </zip>
- -->
- </target>
-
- <!--
- TARGET Build Product
- -->
- <target name="buildProduct" depends="init" description="Builds a product">
- <!-- Load provided build.properties to leave a chance to override -->
- <property file="${buildConfiguration.dir}/build.properties" />
- <!-- Set default properties -->
- <property name="archivePrefix" value="${elementId}" />
- <property name="buildId" value="${archivePrefix}" />
- <property name="buildLabel" value="${archivePrefix}" />
- <property name="collectingFolder" value="${archivePrefix}" />
- <property name="skipFetch" value="true" />
- <property name="skipMaps" value="true" />
- <property name="runPackager" value="true" />
-
- <!-- Find PDE build file -->
- <pathconvert pathsep="" property="productBuildFile">
- <path>
- <fileset dir="${pdeBuilder}/plugins">
- <include name="org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
- </fileset>
- </path>
- </pathconvert>
- <echo message="productBuildFile=${productBuildFile}" />
-
- <!-- Copy sources -->
- <property name="buildDirectory" location="${project.build.directory}/productBuild" />
- <mkdir dir="${buildDirectory}" />
- <copy todir="${buildDirectory}" includeemptydirs="true" verbose="true">
- <fileset dir="${projectDirectory}/../..">
- <include name="plugins/**" />
- <include name="features/**" />
- <exclude name="**/.svn/**" />
- <exclude name="**/target/**" />
- </fileset>
- </copy>
-
- <!-- Execute -->
- <eclipseAnt antfile="${productBuildFile}" antargs="-Dbuilder=${buildConfiguration.dir} -DbuildDirectory=${buildDirectory} -DbaseLocation=${eclipseTarget} -Dbase=${base} -DpluginPath=${dependencyDir} -DarchivePrefix=${archivePrefix} -DbuildLabel=${buildLabel} -DbuildId=${buildId} -DcollectingFolder=${collectingFolder} -DskipFetch=${skipFetch} -DskipMaps=${skipMaps} -DrunPackager=${runPackager}" />
-
- <!-- Copy to target dir -->
- <copy todir="${project.build.directory}">
- <fileset dir="${buildDirectory}/${collectingFolder}">
- <include name="*.zip" />
- </fileset>
- <globmapper from="${archivePrefix}-*" to="${elementId}-*" />
- </copy>
- </target>
-
- <!--
- TARGET eclipseTarget-collect
- -->
- <target name="eclipseTarget-collect" description="Creates an Eclipse target location based on the dependencies">
- <taskdef resource="net/sf/antcontrib/antlib.xml" />
- <for param="dir">
- <dirset dir="${project.build.directory}/dependency">
- <include name="*" />
- </dirset>
- <sequential>
- <copy todir="${eclipseTarget}" failonerror="false">
- <fileset dir="@{dir}">
- <include name="plugins/**" />
- <include name="features/**" />
- </fileset>
- </copy>
- <copy todir="${eclipseTarget}" failonerror="false">
- <fileset dir="@{dir}/eclipse">
- <include name="plugins/**" />
- <include name="features/**" />
- </fileset>
- </copy>
- </sequential>
- </for>
-
- <!-- Copy configuration from SDK -->
- <for param="dir">
- <dirset dir="${project.build.directory}/dependency">
- <include name="eclipse-sdk-*" />
- </dirset>
- <sequential>
- <copy todir="${eclipseTarget}" failonerror="false">
- <fileset dir="@{dir}/eclipse">
- <include name="configuration/**" />
- </fileset>
- </copy>
- </sequential>
- </for>
- </target>
-
- <!--
- COMMON UTILITIES
- -->
- <target name="init">
- <path id="pdeBuilder.launcher.classpath">
- <fileset dir="${pdeBuilder}/plugins">
- <include name="org.eclipse.equinox.launcher_*.jar" />
- </fileset>
- </path>
-
- <!-- Log properties -->
- <echo message="basedir=${basedir}" />
- <echo message="ant.file=${ant.file}" />
- <echo message="projectDirectory=${projectDirectory}" />
-
- <echo message="pdeBuilder=${pdeBuilder}" />
- <echo message="eclipseTarget=${eclipseTarget}" />
-
- <echo message="elementType=${elementType}" />
- <echo message="elementId=${elementId}" />
- <echo message="elementBuildScript=${elementBuildScript}" />
- <echo message="buildScriptTargets=${buildScriptTargets}" />
- <echo message="buildScriptProperties=${buildScriptProperties}" />
-
- <echo message="eclipseAntArgs=${eclipseAntArgs}" />
-
- <echo message="buildConfiguration.dir=${buildConfiguration.dir}" />
- </target>
- <!--
- <target name="setPluginPath">
- <mkdir dir="${dependencyDir}" />
- <pathconvert property="pluginPath">
- <path>
- <pathelement location="${dependencyDir}" />
- <dirset dir="${pluginPathBase}">
- <include name="*" />
- </dirset>
- </path>
- </pathconvert>
- <echo message="pluginPath=${pluginPath}" />
- </target>
--->
- <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
- <target name="eclipse.generateScripts" depends="init">
- <fail message="Property elementType has to be set" unless="elementType" />
- <eclipse.buildScript elements="${elementType}@${elementId}" buildDirectory="${buildDirectory}" baseLocation="${eclipseTarget}" outputUpdateJars="true" generateVersionsLists="true" pluginPath="${dependencyDir}" />
- </target>
-
- <!-- MACRODEFS -->
- <macrodef name="eclipseAnt">
- <attribute name="antfile" />
- <attribute name="antargs" />
- <sequential>
- <echo message="Call Eclipse Ant for file @{antfile} with args ${eclipseAntArgs} @{antargs}" />
- <java fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
- <classpath refid="pdeBuilder.launcher.classpath" />
- <arg line="-data ${argeo-pde.dir}/workspace" />
- <arg line="-application org.eclipse.ant.core.antRunner" />
- <arg line="-buildfile @{antfile}" />
- <arg line="${eclipseAntArgs}" />
- <arg line="@{antargs}" />
- </java>
- </sequential>
- </macrodef>
-</project>
\ No newline at end of file
+++ /dev/null
-<pluginMetadata>
- <mojos>
- <mojo>
- <goal>buildElement</goal>
- <call>buildElement</call>
- <description>
- Builds an element (plugin or feature)
- </description>
-
- <requiresProject>true</requiresProject>
-
- <parameters>
- <!-- Common -->
- <parameter>
- <name>eclipseAntArgs</name>
- <property>eclipseAntArgs</property>
- <expression>${eclipseAntArgs}</expression>
- <defaultValue></defaultValue>
- <type>java.lang.String</type>
- <description>
- Additional args passed to Eclipse Ant (such as
- verbose/debug level)
- </description>
- </parameter>
- <parameter>
- <name>elementId</name>
- <property>elementId</property>
- <required>true</required>
- <defaultValue>${project.artifactId}
- </defaultValue>
- <type>java.lang.String</type>
- <description>
- The artifact id of the project by default, will
- be used
- as element id.
- </description>
- </parameter>
- <!-- Specific -->
- <parameter>
- <name>buildScriptTargets</name>
- <property>buildScriptTargets</property>
- <required>true</required>
- <expression>${buildScriptTargets}</expression>
- <defaultValue>
- build.update.jar zip.distribution
- </defaultValue>
- <type>java.lang.String</type>
- <description>
- The targets to execute in the generated build
- script
- </description>
- </parameter>
- <parameter>
- <name>buildScriptProperties</name>
- <property>buildScriptProperties</property>
- <required>true</required>
- <expression>${buildScriptProperties}
- </expression>
- <defaultValue></defaultValue>
- <type>java.lang.String</type>
- <description>
- The properties to pass to the generated build
- script
- </description>
- </parameter>
- </parameters>
- </mojo>
-
-
- <mojo>
- <goal>buildProduct</goal>
- <call>buildProduct</call>
- <description>Builds a product</description>
-
- <requiresProject>true</requiresProject>
-
- <parameters>
- <!-- Common -->
- <!-- TODO: remove -->
- <parameter>
- <name>eclipseBuildDir</name>
- <property>eclipseBuildDir</property>
- <required>true</required>
- <expression>${eclipseBuildDir}</expression>
- <type>java.lang.String</type>
- <description>
- The Eclipse build dir location
- </description>
- </parameter>
- <parameter>
- <name>eclipseAntArgs</name>
- <property>eclipseAntArgs</property>
- <expression>${eclipseAntArgs}</expression>
- <defaultValue></defaultValue>
- <type>java.lang.String</type>
- <description>
- Additional args passed to Eclipse Ant (such as
- verbose/debug level)
- </description>
- </parameter>
- <parameter>
- <name>elementId</name>
- <property>elementId</property>
- <required>true</required>
- <defaultValue>${project.artifactId}
- </defaultValue>
- <type>java.lang.String</type>
- <description>
- The artifact id of the project by default, will
- be used
- as element id.
- </description>
- </parameter>
- <!-- Specific -->
- <parameter>
- <name>buildConfiguration</name>
- <property>buildConfiguration</property>
- <required>true</required>
- <defaultValue>buildConfiguration</defaultValue>
- <expression>${buildConfiguration}</expression>
- <type>java.lang.String</type>
- <description>
- Relative path to the product build directory
- </description>
- </parameter>
- </parameters>
- </mojo>
-
-
- <mojo>
- <goal>clean</goal>
- <call>clean</call>
- <description>Clean generated artifacts</description>
- <requiresProject>true</requiresProject>
-
- <parameters>
- <parameter>
- <name>elementId</name>
- <property>elementId</property>
- <required>true</required>
- <readonly>true</readonly>
- <defaultValue>${project.artifactId}
- </defaultValue>
- <type>java.lang.String</type>
- <description>
- The artifact id of the project by default, will
- be used
- as element id.
- </description>
- </parameter>
- </parameters>
- </mojo>
-
- <mojo>
- <goal>eclipseTarget-collect</goal>
- <call>eclipseTarget-collect</call>
- <description>
- Installs an Eclipse target based on dependencies
- </description>
- <requiresProject>true</requiresProject>
- </mojo>
- </mojos>
-</pluginMetadata>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>argeo.slc.testfeature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-bin.includes = feature.xml
+++ /dev/null
-<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">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.argeo.slc.sandbox</groupId>
- <artifactId>argeo.slc.testfeature</artifactId>
- <version>0.1.1-SNAPSHOT</version>
- <packaging>eclipseFeature</packaging>
- <name>Argeo SLC Test Eclipse Feature</name>
- <scm>
- <developerConnection>
- scm:svn:https://www.argeo.org/svn/slc/trunk/maven/plugins/maven-argeo-pde-plugin/src/test/eclipse/features/argeo.slc.testfeature
- </developerConnection>
- </scm>
- <build>
- <plugins>
- <plugin>
- <groupId>org.argeo.slc.maven</groupId>
- <artifactId>maven-argeo-pde-plugin</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- <extensions>true</extensions>
- <configuration>
- <buildScriptProperties><![CDATA[-DjavacSource=1.5 -DjavacTarget=1.5]]></buildScriptProperties>
- <feature>
- <plugins>
- <plugin>
- <id>argeo.slc.testplugin</id>
- <version>1.0.0.qualifier</version>
- </plugin>
- </plugins>
- </feature>
- </configuration>
- </plugin>
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>getScmRevision</id>
- <phase>validate</phase>
- <goals>
- <goal>create</goal>
- </goals>
- <configuration>
- <buildNumberPropertyName>scmRevision</buildNumberPropertyName>
- <doCheck>false</doCheck>
- <doUpdate>true</doUpdate>
- </configuration>
- </execution>
- <execution> <id>getTimestamp</id> <phase>initialize</phase>
- <goals> <goal>create</goal> </goals> <configuration>
- <format>{0}_{1,date,yyyyMMddHHmmss}</format> <items>
- <item>${scmRevision}</item> <item>timestamp</item> </items>
- </configuration> </execution>
- </executions>
- <configuration>
- <doCheck>false</doCheck>
- <doUpdate>true</doUpdate>
- </configuration>
- </plugin>
- -->
- </plugins>
- </build>
-
- <dependencies>
- <!-- Eclipse Base -->
- <dependency>
- <groupId>org.argeo.dep.dist</groupId>
- <artifactId>eclipse-sdk-linux-gtk</artifactId>
- <version>3.4.1</version>
- <type>tar.gz</type>
- <classifier>dist</classifier>
- </dependency>
- <dependency>
- <groupId>org.argeo.dep.dist</groupId>
- <artifactId>eclipse-rcp-deltapack</artifactId>
- <version>3.4.1</version>
- <type>zip</type>
- <classifier>dist</classifier>
- </dependency>
- </dependencies>
- <pluginRepositories>
- <pluginRepository>
- <id>argeo-plugins</id>
- <url>http://www.argeo.org/maven/argeo</url>
- </pluginRepository>
- </pluginRepositories>
-
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <feature url="features/org.argeo.slc.ui.launch.feature_${org.argeo.slc.ui.launch.feature}.jar" id="org.argeo.slc.ui.launch.feature" version="${org.argeo.slc.ui.launch.feature}">
- <category name="argeo.slc.ui"/>
- </feature>
- <category-def name="argeo.slc.ui" label="Argeo SLC UI">
- <description>
- UI extensions used to simplify development based on Argeo SLC.
- </description>
- </category-def>
-</site>
+++ /dev/null
-<?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.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>argeo.slc.testplugin</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Dec 05 11:33:10 CET 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+++ /dev/null
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Testplugin Plug-in
-Bundle-SymbolicName: argeo.slc.testplugin; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: argeo.slc.testplugin.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+++ /dev/null
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- contexts.xml
+++ /dev/null
-<contexts>
- <context id="viewer" title="Sample View">
- <description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
- <topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
- <enablement>
- <with variable="platform">
- <test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
- </with>
- </enablement>
- </topic>
- </context>
-</contexts>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Sample Category"
- id="argeo.slc.testplugin">
- </category>
- <view
- name="Sample View"
- icon="icons/sample.gif"
- category="argeo.slc.testplugin"
- class="argeo.slc.testplugin.views.SampleView"
- id="argeo.slc.testplugin.views.SampleView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.jdt.ui.JavaPerspective">
- <view
- ratio="0.5"
- relative="org.eclipse.ui.views.TaskList"
- relationship="right"
- id="argeo.slc.testplugin.views.SampleView">
- </view>
- </perspectiveExtension>
- </extension>
-
-</plugin>
+++ /dev/null
-package argeo.slc.testplugin;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "argeo.slc.testplugin";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
+++ /dev/null
-package argeo.slc.testplugin.views;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.SWT;
-
-
-/**
- * This sample class demonstrates how to plug-in a new
- * workbench view. The view shows data obtained from the
- * model. The sample creates a dummy model on the fly,
- * but a real implementation would connect to the model
- * available either in this or another plug-in (e.g. the workspace).
- * The view is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model
- * objects should be presented in the view. Each
- * view can present the same model objects using
- * different labels and icons, if needed. Alternatively,
- * a single label provider can be shared between views
- * in order to ensure that objects of the same type are
- * presented in the same way everywhere.
- * <p>
- */
-
-public class SampleView extends ViewPart {
- private TableViewer viewer;
- private Action action1;
- private Action action2;
- private Action doubleClickAction;
-
- /*
- * The content provider class is responsible for
- * providing objects to the view. It can wrap
- * existing objects in adapters or simply return
- * objects as-is. These objects may be sensitive
- * to the current input of the view, or ignore
- * it and always show the same content
- * (like Task List, for example).
- */
-
- class ViewContentProvider implements IStructuredContentProvider {
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
- public void dispose() {
- }
- public Object[] getElements(Object parent) {
- return new String[] { "One", "Two", "Three" };
- }
- }
- class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object obj, int index) {
- return getText(obj);
- }
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
- public Image getImage(Object obj) {
- return PlatformUI.getWorkbench().
- getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
- }
- }
- class NameSorter extends ViewerSorter {
- }
-
- /**
- * The constructor.
- */
- public SampleView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setSorter(new NameSorter());
- viewer.setInput(getViewSite());
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "argeo.slc.testplugin.viewer");
- makeActions();
- hookContextMenu();
- hookDoubleClickAction();
- contributeToActionBars();
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- SampleView.this.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void fillLocalPullDown(IMenuManager manager) {
- manager.add(action1);
- manager.add(new Separator());
- manager.add(action2);
- }
-
- private void fillContextMenu(IMenuManager manager) {
- manager.add(action1);
- manager.add(action2);
- // Other plug-ins can contribute there actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(IToolBarManager manager) {
- manager.add(action1);
- manager.add(action2);
- }
-
- private void makeActions() {
- action1 = new Action() {
- public void run() {
- showMessage("Action 1 executed");
- }
- };
- action1.setText("Action 1");
- action1.setToolTipText("Action 1 tooltip");
- action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
-
- action2 = new Action() {
- public void run() {
- showMessage("Action 2 executed");
- }
- };
- action2.setText("Action 2");
- action2.setToolTipText("Action 2 tooltip");
- action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- doubleClickAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- showMessage("Double-click detected on "+obj.toString());
- }
- };
- }
-
- private void hookDoubleClickAction() {
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- doubleClickAction.run();
- }
- });
- }
- private void showMessage(String message) {
- MessageDialog.openInformation(
- viewer.getControl().getShell(),
- "Sample View",
- message);
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file