You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

publish.xml 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="publish" basedir="." default="" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  3. <include file="common.xml" as="common" />
  4. <include file="build.xml" as="vaadin" />
  5. <!-- Dummy value as ivysettings-publish require a value -->
  6. <property name="publish.sftp.keyfile" value="/dummy" />
  7. <property name="publish.sftp.ivy.pattern" value="dummy" />
  8. <ivy:settings file="ivysettings.xml" />
  9. <ivy:settings file="ivysettings-publish.xml" id="publish.settings" />
  10. <property file="publish.properties" />
  11. <target name="nightly.publish" depends="nightly.download.publish, nightly.maven.publish">
  12. </target>
  13. <!-- Copies the nightly build artifacts to the download server. -->
  14. <target name="nightly.tests.publish" if="nightly.tests.publish">
  15. <property name="file.war" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${version}.war" />
  16. <property name="target" value="${nightly.tests.publish}/${vaadin.version.major}.${vaadin.version.minor}-${build.tag}.war" />
  17. <fail unless="ant-jsch.present" message="Please install ant-jsch.jar into ANT_HOME/lib" />
  18. <fail unless="jsch.present" message="Please install jsch.jar into ANT_HOME/lib" />
  19. <echo>Installing ${src} to ${target}</echo>
  20. <scp todir="${nightly.tests.publish}" file="${file.war}">
  21. </scp>
  22. </target>
  23. <target name="nightly.download.publish">
  24. <antcontrib:foreach list="${modules.to.publish.to.download}" target="publish.module.to.download.site" param="module" />
  25. </target>
  26. <target name="nightly.maven.publish">
  27. <antcontrib:foreach list="${modules.to.publish.to.maven}" target="publish.module.to.maven" param="module" />
  28. </target>
  29. <target name="publish.module.to.download.site">
  30. <fail unless="module" message="No module to publish defined" />
  31. <ivy:resolve log="download-only" file="${module}/ivy.xml" />
  32. <ivy:publish publishivy="false" settingsref="publish.settings" conf="*(public)" resolver="sftp-publish">
  33. <artifacts pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision](-[classifier]).[ext]" />
  34. </ivy:publish>
  35. </target>
  36. <target name="publish.module.to.maven">
  37. <fail unless="module" message="No module to publish defined" />
  38. <property file="${gpg.passphrase.file}" />
  39. <!-- Ivy should be able to handle this but this does not work at
  40. the moment <ivy:resolve log="download-only" file="${module}/ivy.xml" /> <ivy:publish pubrevision="7.0-SNAPSHOT"
  41. publishivy="false" settingsref="publish.settings" conf="*(public)" resolver="sonatype">
  42. <artifacts pattern="${ivy.settings.dir}/result/artifacts/${vaadin.version}/[module]/[artifact]-${vaadin.version}(-[classifier]).[ext]"
  43. /> </ivy:publish> -->
  44. <property name="jar.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.jar" />
  45. <property name="pom.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.pom" />
  46. <antcontrib:if>
  47. <available file="${jar.file}"/>
  48. <then>
  49. <artifact:mvn failonerror="true">
  50. <arg value="gpg:sign-and-deploy-file" />
  51. <sysproperty key="file" value="${jar.file}" />
  52. <sysproperty key="pomFile" value="${pom.file}" />
  53. <sysproperty key="repositoryId" value="${maven.snapshot.repository.id}" />
  54. <sysproperty key="url" value="${maven.snapshot.repository.url}" />
  55. <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
  56. <sysproperty key="retryFailedDeploymentCount" value="10" />
  57. </artifact:mvn>
  58. </then>
  59. <else>
  60. <artifact:mvn failonerror="true">
  61. <arg value="gpg:sign-and-deploy-file" />
  62. <sysproperty key="file" value="${pom.file}" />
  63. <sysproperty key="pomFile" value="${pom.file}" />
  64. <sysproperty key="generatePom" value="false" />
  65. <sysproperty key="packaging" value="pom" />
  66. <sysproperty key="repositoryId" value="${maven.snapshot.repository.id}" />
  67. <sysproperty key="url" value="${maven.snapshot.repository.url}" />
  68. <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
  69. <sysproperty key="retryFailedDeploymentCount" value="10" />
  70. </artifact:mvn>
  71. </else>
  72. </antcontrib:if>
  73. </target>
  74. <!-- Use this to publish to local Maven repo -->
  75. <!-- If you have compiled a snapshot build with: -->
  76. <!-- ant -Dvaadin.version=7.x.x.zzz package -->
  77. <!-- Publish with: -->
  78. <!-- ant -f publish.xml -Dvaadin.version=7.x.x.zzz local.maven.publish -->
  79. <!-- Note that if the build is a snapshot build, it will be installed as -->
  80. <!-- 7.x-SNAPSHOT. -->
  81. <target name="local.maven.publish">
  82. <antcontrib:foreach list="${modules.to.publish.to.maven}" target="publish.module.to.local.maven" param="module" />
  83. </target>
  84. <target name="publish.module.to.local.maven">
  85. <fail unless="module" message="No module to publish defined" />
  86. <property name="jar.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.jar" />
  87. <property name="javadoc.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}-javadoc.jar" />
  88. <property name="sources.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}-sources.jar" />
  89. <property name="pom.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.pom" />
  90. <antcontrib:if>
  91. <available file="${jar.file}"/>
  92. <then>
  93. <artifact:mvn failonerror="true">
  94. <arg value="install:install-file" />
  95. <sysproperty key="file" value="${jar.file}" />
  96. <sysproperty key="pomFile" value="${pom.file}" />
  97. <sysproperty key="javadoc" value="${javadoc.file}" />
  98. <sysproperty key="sources" value="${sources.file}" />
  99. </artifact:mvn>
  100. </then>
  101. <else>
  102. <artifact:mvn failonerror="true">
  103. <arg value="install:install-file" />
  104. <sysproperty key="file" value="${pom.file}" />
  105. <sysproperty key="pomFile" value="${pom.file}" />
  106. <sysproperty key="generatePom" value="false" />
  107. <sysproperty key="packaging" value="pom" />
  108. </artifact:mvn>
  109. </else>
  110. </antcontrib:if>
  111. </target>
  112. </project>