diff options
Diffstat (limited to 'buildScripts/website.ant.xml')
-rw-r--r-- | buildScripts/website.ant.xml | 95 |
1 files changed, 70 insertions, 25 deletions
diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index c27d81fa..36b3a193 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -19,7 +19,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> -<project name="lombok-website" basedir=".." default="website"> +<project name="lombok-website" basedir=".." default="website" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> <description> This buildfile is part of projectlombok.org. It is responsible for building the website and all website-related aspects, such as applying the templates to produce the website, converting the changelog into HTML, and creating javadoc. @@ -37,12 +37,42 @@ such as applying the templates to produce the website, converting the changelog <delete dir="build/website" quiet="true" /> </target> - <target name="website" description="Prepares the website for distribution" depends="-website-main, -website-dist" /> + <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'." depends="-fetch-version-from-site, -show-version, -ensure-version, -website-main, -delete-edge-page, -website-only-dist" /> + + <target name="-delete-edge-page"> + <delete file="build/website/download-edge.html" /> + </target> + + <target name="website" description="Prepares the website for distribution" depends="javadoc, -website-main, -website-dist" /> + + <target name="-fetch-version-from-site" depends="-compile-webclasses"> + <fail if="lombok.version">lombok.version already set.</fail> + <fail if="lombok.fullversion">lombok.fullversion already set.</fail> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.version" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="base" /> + </java> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.fullversion" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="full" /> + </java> + </target> <target name="-ensure-version" unless="lombok.version"> <fail>Supply lombok.version</fail> </target> + <target name="-show-version"> + <echo>Version: ${lombok.version}</echo> + <echo>Full: ${lombok.fullversion}</echo> + </target> + <target name="-ensure-fullversion" unless="lombok.fullversion"> <fail>Supply lombok.fullversion</fail> </target> @@ -68,7 +98,7 @@ such as applying the templates to produce the website, converting the changelog </java> </target> - <target name="-website-main" depends="-ensure-version, -ensure-fullversion, -website-clean, -compile-webclasses, javadoc, changelogToHtml"> + <target name="-website-main" depends="-ensure-version, -ensure-fullversion, -website-clean, -compile-webclasses, changelogToHtml"> <mkdir dir="build/website" /> <copy todir="build/website"> <fileset dir="website/resources" /> @@ -95,19 +125,29 @@ such as applying the templates to produce the website, converting the changelog </tar> </target> - <taskdef name="scp" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.Scp" classpathref="build.path" /> - <taskdef name="sshexec" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="build.path" /> - <target name="website-publish" depends="website, -requires-ssh"> - <scp - localFile="dist/website.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" + <target name="-website-only-dist"> + <mkdir dir="dist" /> + <tar destfile="dist/website.tar.bz2" compression="bzip2"> + <tarfileset dir="build/website" /> + </tar> + </target> + + <target name="website-publish" depends="website, -send-site-to-remote" /> + <target name="website-only-publish" depends="website-only, -send-site-to-remote" /> + <target name="-send-site-to-remote" depends="-requires-ssh"> + <ivy:scpUpload + from="dist/website.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployWebsite" /> + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployWebsite" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> <target name="latestChanges" depends="-compile-webclasses, -ensure-version, -ensure-fullversion"> @@ -150,17 +190,22 @@ such as applying the templates to produce the website, converting the changelog </target> <target name="edgeRelease" depends="-requires-ssh, edgeRelease-build"> - <scp - localFile="dist/website-edge.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" username="${ssh.username}" keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployEdge" /> + <ivy:scpUpload + from="dist/website-edge.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployEdge" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> - <target name="javadoc" description="Generates the javadoc" depends="-ensure-version, -ensure-fullversion"> + <target name="javadoc" description="Generates the javadoc" depends="-ensure-version, -ensure-fullversion" unless="skip.javadoc"> <delete dir="build/api" quiet="true" /> <delete dir="doc/api" quiet="true" /> <mkdir dir="build/api" /> @@ -178,7 +223,7 @@ such as applying the templates to produce the website, converting the changelog <classpath refid="build.path" /> <classpath location="build/lombok" /> <header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header> - <bottom><![CDATA[<i>Copyright © 2009-2015 The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> + <bottom><![CDATA[<i>Copyright © 2009-2018 The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> </javadoc> <!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref. is-external=true doesn't actually do anything, so, we'll just get rid of it. --> |