diff options
author | Martin Taal | 2014-06-15 08:02:33 +0000 |
---|---|---|
committer | Martin Taal | 2014-06-15 08:02:33 +0000 |
commit | 130bdd7c88f37809ff8baa6efa9078ffaadec050 (patch) | |
tree | 6eec4b119b285030d59c7a1554e4cf7ce92928f5 | |
parent | bea900fc7e88fb86c9247ae56983e1deedcc3546 (diff) | |
download | org.eclipse.emf.teneo-130bdd7c88f37809ff8baa6efa9078ffaadec050.tar.gz org.eclipse.emf.teneo-130bdd7c88f37809ff8baa6efa9078ffaadec050.tar.xz org.eclipse.emf.teneo-130bdd7c88f37809ff8baa6efa9078ffaadec050.zip |
Added project to automate maven publication of emf file
9 files changed, 584 insertions, 0 deletions
diff --git a/build/org.eclipse.emf.teneo.internal.utils/.classpath b/build/org.eclipse.emf.teneo.internal.utils/.classpath new file mode 100644 index 000000000..fb565a588 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/build/org.eclipse.emf.teneo.internal.utils/.project b/build/org.eclipse.emf.teneo.internal.utils/.project new file mode 100644 index 000000000..b7e911097 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.teneo.internal.utils</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.core.prefs b/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..7341ab168 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +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.7 diff --git a/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.ui.prefs b/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..974ae040f --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,54 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/emf_maven_publish.xml b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/emf_maven_publish.xml new file mode 100644 index 000000000..db154cb18 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/emf_maven_publish.xml @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project default="deploy.snapshot" name="Teneo Maven Publish" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> + <property environment="env" /> + <property name="mainLocation" location="/home/mtaal/mydata/dev/maven/emfmaven" /> + + <property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" /> + <property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" /> + <property name="maven-staging-repository-id" value="sonatype-nexus-staging" /> + <property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> + + <macrodef name="deploy.snapshot"> + <attribute name="name"/> + <attribute name="jarFileLocation"/> + <attribute name="version"/> + <sequential> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" /> + <arg value="-Durl=${maven-snapshots-repository-url}" /> + <arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> + <arg value="-DpomFile=@{jarFileLocation}/@{name}-@{version}.pom" /> + <arg value="-Dfile=@{jarFileLocation}/@{name}-@{version}.jar" /> + <arg value="-e" /> + </artifact:mvn> + </sequential> + </macrodef> + + <macrodef name="deploy.staging"> + <attribute name="name"/> + <attribute name="jarFileLocation"/> + <attribute name="version"/> + <sequential> + <!-- sign and deploy the main artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=@{jarFileLocation}/@{name}-@{version}.pom" /> + <arg value="-Dfile=@{jarFileLocation}/@{name}-@{version}.jar" /> + <arg value="-e" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the sources artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=@{jarFileLocation}/@{name}-@{version}.pom" /> + <arg value="-Dfile=@{jarFileLocation}/@{name}-@{version}-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the javadoc artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=@{jarFileLocation}/@{name}-@{version}.pom" /> + <arg value="-Dfile=@{jarFileLocation}/@{name}-@{version}-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Pgpg" /> + </artifact:mvn> + </sequential> + </macrodef> + + <target name="deploy.snapshot"> + <!--deploy.snapshot name="org.eclipse.emf.ecore" version="2.7.0-v20110605-0747" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.7.0-v20110520-1406" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.7.0-v20110605-0747" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.snapshot name="org.eclipse.emf.ecore" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.snapshot name="org.eclipse.emf.ecore" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/ + + <deploy.snapshot name="org.eclipse.emf.codegen.ecore" version="2.10.0-v20130930-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/> + <deploy.snapshot name="org.eclipse.emf.codegen" version="2.9.0-v20130930-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/> + <deploy.snapshot name="org.eclipse.emf.ecore" version="2.10.0-v20130911-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.10.0.v20130911-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.10.0-v20130911-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/> + + <deploy.snapshot name="org.eclipse.emf.codegen.ecore" version="2.10.0-v20140127-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> + <deploy.snapshot name="org.eclipse.emf.codegen" version="2.10.0-v20140127-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> + <deploy.snapshot name="org.eclipse.emf.ecore" version="2.10.0-v20140117-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.10.0-v20140117-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.10.0-v20140117-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> +--> + + <deploy.snapshot name="org.eclipse.emf.codegen.ecore" version="2.10.0-v20140519-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.emf.codegen" version="2.10.0-v20140519-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.emf.common" version="2.10.0-v20140514-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.emf.ecore" version="2.10.0-v20140514-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.emf.ecore.xmi" version="2.10.0-v20140514-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.xsd" version="2.10.0-v20140519-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + <deploy.snapshot name="org.eclipse.emf.mapping.ecore2xml" version="2.8.0-v20140519-SNAPSHOT" jarFileLocation="${mainLocation}/2.10RC1"/> + </target> + + <target name="deploy.staging"> + <!--deploy.staging name="org.eclipse.emf.ecore" version="2.7.0-v20110605-0747" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.staging name="org.eclipse.emf.ecore.xmi" version="2.7.0-v20110520-1406" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.staging name="org.eclipse.emf.common" version="2.7.0-v20110605-0747" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.staging name="org.eclipse.emf.ecore" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.staging name="org.eclipse.emf.ecore.xmi" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.staging name="org.eclipse.emf.common" version="2.8.0-v20120911-0500" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.staging name="org.eclipse.emf.ecore" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/> + <deploy.staging name="org.eclipse.emf.ecore.xmi" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/> + <deploy.staging name="org.eclipse.emf.common" version="2.9.0-v20130528-0742" jarFileLocation="${mainLocation}/2.9.0"/ + + <deploy.staging name="org.eclipse.emf.codegen" version="2.9.0-v20130902-0605" jarFileLocation="${mainLocation}/2.9.1"/> + <deploy.staging name="org.eclipse.emf.codegen.ecore" version="2.9.1-v20130902-0605" jarFileLocation="${mainLocation}/2.9.1"/> + <deploy.staging name="org.eclipse.emf.ecore" version="2.9.1-v20130827-0309" jarFileLocation="${mainLocation}/2.9.1"/> + <deploy.staging name="org.eclipse.emf.ecore.xmi" version="2.9.1-v20130827-0309" jarFileLocation="${mainLocation}/2.9.1"/> + <deploy.staging name="org.eclipse.emf.common" version="2.9.1-v20130827-0309" jarFileLocation="${mainLocation}/2.9.1"/> +--> + + <deploy.staging name="org.eclipse.emf.codegen" version="2.9.0-v20140203-1126" jarFileLocation="${mainLocation}/2.9.2"/> + <deploy.staging name="org.eclipse.emf.codegen.ecore" version="2.9.1-v20140203-1126" jarFileLocation="${mainLocation}/2.9.2"/> + <deploy.staging name="org.eclipse.emf.ecore" version="2.9.2-v20131212-0545" jarFileLocation="${mainLocation}/2.9.2"/> + <deploy.staging name="org.eclipse.emf.ecore.xmi" version="2.9.1-v20131212-0545" jarFileLocation="${mainLocation}/2.9.2"/> + <deploy.staging name="org.eclipse.emf.common" version="2.9.2-v20131212-0545" jarFileLocation="${mainLocation}/2.9.2"/> + </target> + + <target name="deploy.snapshot.xsd"> + <!--deploy.snapshot name="org.eclipse.xsd" version="2.7.0-v20110606-0949" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.snapshot name="org.eclipse.xsd" version="2.8.0-v20120319-0555" jarFileLocation="${mainLocation}/2.8.0"/ + <deploy.snapshot name="org.eclipse.xsd" version="2.9.0-v20130610-0406" jarFileLocation="${mainLocation}/2.9.0"/ + <deploy.snapshot name="org.eclipse.xsd" version="2.10.0-v20130930-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M2"/>--> + <deploy.snapshot name="org.eclipse.xsd" version="2.10.0-v20140127-SNAPSHOT" jarFileLocation="${mainLocation}/2.10M5"/> + </target> + + <target name="deploy.staging.xsd"> + <!--deploy.staging name="org.eclipse.xsd" version="2.7.0-v20110606-0949" jarFileLocation="${mainLocation}/2.7.0"/> + <deploy.staging name="org.eclipse.xsd" version="2.8.0-v20120319-0555" jarFileLocation="${mainLocation}/2.8.0"/> + <deploy.staging name="org.eclipse.xsd" version="2.9.0-v20130610-0406" jarFileLocation="${mainLocation}/2.9.0"/ + <deploy.staging name="org.eclipse.xsd" version="2.9.1-v20130902-0605" jarFileLocation="${mainLocation}/2.9.1"/>--> + <deploy.staging name="org.eclipse.xsd" version="2.9.1-v20140203-1126" jarFileLocation="${mainLocation}/2.9.2"/> + </target> + +</project> + diff --git a/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven.sh b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven.sh new file mode 100755 index 000000000..dd57b87c5 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven.sh @@ -0,0 +1,11 @@ +cd /home/mtaal/mydownloads +rm -rf mavendownload +mkdir mavendownload +cd mavendownload +wget https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ws/build/result/maven/*zip*/maven.zip +unzip maven.zip + +mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-snapshots -DpomFile=blabla.pom -Dfile=blabla.jar +mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=ossrh-test-1.2.pom -Dfile=ossrh-test-1.2-sources.jar -Dclassifier=sources + + diff --git a/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven_publish.xml b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven_publish.xml new file mode 100644 index 000000000..d646482cf --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/teneo_maven_publish.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project default="deploy.snapshot" name="Teneo Maven Publish" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> + <property environment="env" /> + <property name="version" value="2.0.1"/> + <property name="qualifier" value="v201311180843"/> + <property name="jarDownloadLocation" location="/home/mtaal/mydownloads/teneomaven" /> + <property name="jarFileLocation" location="/home/mtaal/mydownloads/teneomaven/maven" /> + + <property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" /> + <property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" /> + <property name="maven-staging-repository-id" value="sonatype-nexus-staging" /> + <property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> + + <macrodef name="deploy.snapshot"> + <attribute name="name"/> + <sequential> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" /> + <arg value="-Durl=${maven-snapshots-repository-url}" /> + <arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.jar" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-snapshots-repository-url}" /> + <arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-SNAPSHOT-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Pgpg" /> + </artifact:mvn> + </sequential> + </macrodef> + + <macrodef name="deploy.staging"> + <attribute name="name"/> + <sequential> + <!-- sign and deploy the main artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}.jar" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the sources artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the javadoc artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Pgpg" /> + </artifact:mvn> + </sequential> + </macrodef> + + <target name="deploy.snapshot" depends="init"> + <deploy.snapshot name="org.eclipse.emf.teneo"/> + <deploy.snapshot name="org.eclipse.emf.teneo.annotations"/> + <deploy.snapshot name="org.eclipse.emf.teneo.hibernate"/> + <deploy.snapshot name="org.eclipse.emf.teneo.hibernate.mapper"/> + </target> + + <target name="deploy.staging" depends="init"> + <deploy.staging name="org.eclipse.emf.teneo"/> + <deploy.staging name="org.eclipse.emf.teneo.annotations"/> + <deploy.staging name="org.eclipse.emf.teneo.hibernate"/> + <deploy.staging name="org.eclipse.emf.teneo.hibernate.mapper"/> + </target> + + <target name="init"> + <delete dir="${jarDownloadLocation}" quiet="true" /> + <mkdir dir="${jarDownloadLocation}" /> + <!--get src="https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ws/build/result/maven/*zip*/maven.zip" dest="${jarDownloadLocation}/maven.zip" /--> + <get src="https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/maven/*zip*/maven.zip" dest="${jarDownloadLocation}/maven.zip" /> + <unzip src="${jarDownloadLocation}/maven.zip" dest="${jarDownloadLocation}"/> + </target> + +</project> + diff --git a/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/texo_maven_publish.xml b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/texo_maven_publish.xml new file mode 100644 index 000000000..7657b4ed4 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/publish-scripts/texo_maven_publish.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project default="deploy.snapshot" name="Texo Maven Publish" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> + <property environment="env" /> + <property name="version" value="0.1.0"/> + <property name="qualifier" value="v201310021216"/> + <property name="jarDownloadLocation" location="/home/mtaal/mydownloads/texomaven" /> + <property name="jarFileLocation" location="/home/mtaal/mydownloads/texomaven/maven" /> + + <property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" /> + <property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" /> + <property name="maven-staging-repository-id" value="sonatype-nexus-staging" /> + <property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> + + <macrodef name="deploy.snapshot"> + <attribute name="name"/> + <sequential> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" /> + <arg value="-Durl=${maven-snapshots-repository-url}" /> + <arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.jar" /> + <arg value="-Pgpg" /> + </artifact:mvn> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-snapshots-repository-url}" /> + <arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-SNAPSHOT.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-SNAPSHOT-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Pgpg" /> + </artifact:mvn> + </sequential> + </macrodef> + + <macrodef name="deploy.staging"> + <attribute name="name"/> + <sequential> + <!-- sign and deploy the main artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}.jar" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the sources artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Pgpg" /> + </artifact:mvn> + + <!-- sign and deploy the javadoc artifact --> + <artifact:mvn> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${maven-staging-repository-url}" /> + <arg value="-DrepositoryId=${maven-staging-repository-id}" /> + <arg value="-DpomFile=${jarFileLocation}/@{name}-${version}-${qualifier}.pom" /> + <arg value="-Dfile=${jarFileLocation}/@{name}-${version}-${qualifier}-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Pgpg" /> + </artifact:mvn> + </sequential> + </macrodef> + + <target name="deploy.snapshot" depends="init"> + <deploy.snapshot name="org.eclipse.emf.texo"/> + <deploy.snapshot name="org.eclipse.emf.texo.xml"/> + <deploy.snapshot name="org.eclipse.emf.texo.json"/> + <deploy.snapshot name="org.eclipse.emf.texo.datagenerator"/> + <deploy.snapshot name="org.eclipse.emf.texo.server"/> + </target> + + <target name="deploy.staging" depends="init"> + <deploy.staging name="org.eclipse.emf.texo"/> + <deploy.staging name="org.eclipse.emf.texo.json"/> + <deploy.staging name="org.eclipse.emf.texo.xml"/> + <deploy.staging name="org.eclipse.emf.texo.datagenerator"/> + <deploy.staging name="org.eclipse.emf.texo.server"/> + </target> + + <target name="init"> + <delete dir="${jarDownloadLocation}" quiet="true" /> + <mkdir dir="${jarDownloadLocation}" /> + <!--get src="https://hudson.eclipse.org/hudson/job/emft-texo-nightly/ws/build/result/maven/*zip*/maven.zip" dest="${jarDownloadLocation}/maven.zip" /--> + <get src="https://hudson.eclipse.org/hudson/job/emft-texo-nightly/lastSuccessfulBuild/artifact/build/result/maven/*zip*/maven.zip" dest="${jarDownloadLocation}/maven.zip" /> + <unzip src="${jarDownloadLocation}/maven.zip" dest="${jarDownloadLocation}"/> + </target> + +</project> + diff --git a/build/org.eclipse.emf.teneo.internal.utils/src/org/eclipse/emf/teneo/internal/utils/EmfMavenFileCreator.java b/build/org.eclipse.emf.teneo.internal.utils/src/org/eclipse/emf/teneo/internal/utils/EmfMavenFileCreator.java new file mode 100755 index 000000000..604fd5373 --- /dev/null +++ b/build/org.eclipse.emf.teneo.internal.utils/src/org/eclipse/emf/teneo/internal/utils/EmfMavenFileCreator.java @@ -0,0 +1,146 @@ +/** + * <copyright> + * + * Copyright (c) 2014 Springsite BV (The Netherlands) and others + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Martin Taal - Initial API and implementation + * + * </copyright> + * + * $Id: ClassClassLoaderStrategy.java,v 1.6 2009/03/30 07:53:05 mtaal Exp $ + */ + +package org.eclipse.emf.teneo.internal.utils; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Creates/prepares files for Maven at sonatype.org + * + * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> + * @version $Revision: 1.6 $ + */ + +public class EmfMavenFileCreator { + private static final String BASE_DIR = "/home/mtaal/mydata/dev/maven/emfmaven/"; + private static final String TEMPLATE_DIR = "templates"; + private static final String PLUGINS_DIR = "eclipse/plugins"; + private static final String JAVADOC_FILE_PATH = BASE_DIR + TEMPLATE_DIR + File.separator + + "template-javadoc.jar"; + private static final String POM_FILE_PATH = BASE_DIR + TEMPLATE_DIR + File.separator + + "template.pom"; + + private static final String[] plugins = { "org.eclipse.emf.codegen.ecore", + "org.eclipse.emf.codegen", "org.eclipse.emf.common", "org.eclipse.emf.ecore", + "org.eclipse.emf.ecore.xmi", "org.eclipse.xsd", "org.eclipse.emf.mapping.ecore2xml" }; + + public static void main(String[] args) throws Exception { + final EmfMavenFileCreator creator = new EmfMavenFileCreator(); + creator.setDirName("2.10RC1"); + creator.setSnapShot(true); + creator.process(); + } + + private String dirName; + private boolean isSnapShot; + + private void process() throws Exception { + final String outDirPath = BASE_DIR + dirName + File.separator; + final String sourceDirPath = outDirPath + PLUGINS_DIR + File.separator; + final File mainDir = new File(outDirPath + PLUGINS_DIR); + + // clear all files + for (File file : new File(BASE_DIR + dirName).listFiles()) { + if (file.getName().endsWith(".jar") || file.getName().endsWith(".pom")) { + file.delete(); + } + } + + for (String plugin : plugins) { + for (File file : mainDir.listFiles()) { + final String fileName = file.getName(); + if (ignoreFile(fileName, plugin)) { + continue; + } + final String version = getVersion(plugin, fileName); + final String groupId; + if (plugin.contains(".xsd")) { + groupId = "org.eclipse.xsd"; + } else { + groupId = "org.eclipse.emf"; + } + + // copy the plugin itself + copyFile(sourceDirPath + fileName, outDirPath + plugin + "-" + version + ".jar"); + + // copy the source + final String sourceOriginFileName = fileName.replace("_", ".source_"); + copyFile(sourceDirPath + sourceOriginFileName, outDirPath + plugin + "-" + version + + "-sources.jar"); + + // copy the javadoc template + copyFile(JAVADOC_FILE_PATH, outDirPath + plugin + "-" + version + "-javadoc.jar"); + + // copy the pom + String pom = new String(Files.readAllBytes(Paths.get(POM_FILE_PATH))); + pom = pom.replace("${version}", version); + pom = pom.replace("${name}", plugin); + pom = pom.replace("${artifactId}", plugin); + pom = pom.replace("${groupId}", groupId); + Files.write(Paths.get(outDirPath + plugin + "-" + version + ".pom"), pom.getBytes()); + + System.err.println("<deploy.snapshot name=\"" + plugin + "\" version=\"" + version + + "\" jarFileLocation=\"${mainLocation}/" + dirName + "\"/>"); + } + } + } + + private void copyFile(String sourceFilePath, String destFilePath) throws IOException { + Files.copy(Paths.get(sourceFilePath), Paths.get(destFilePath)); + } + + private boolean ignoreFile(String fileName, String plugin) { + return !fileName.startsWith(plugin + "_") || !fileName.endsWith(".jar") + || fileName.contains("source"); + } + + private String getVersion(String plugin, String fileName) { + // org.eclipse.emf.codegen_2.10.0.v20140127-0448 + // +1 to add the _ + String version = fileName.substring(plugin.length() + 1); + version = version.substring(0, version.length() - ".jar".length()); + // get rid of the 4th dot + final int vIndex = version.indexOf("v"); + version = version.substring(0, vIndex - 1) + "-" + version.substring(vIndex); + if (isSnapShot) { + final int lastDashIndex = version.lastIndexOf("-"); + version = version.substring(0, lastDashIndex) + "-SNAPSHOT"; + } + return version; + } + + public String getDirName() { + return dirName; + } + + public void setDirName(String dirName) { + this.dirName = dirName; + } + + public boolean isSnapShot() { + return isSnapShot; + } + + public void setSnapShot(boolean isSnapShot) { + this.isSnapShot = isSnapShot; + } + +}
\ No newline at end of file |