|
1 | 1 | <!-- |
2 | | - Copyright (C) 2020 The Project Lombok Authors. |
| 2 | + Copyright (C) 2020-2023 The Project Lombok Authors. |
3 | 3 | |
4 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | 5 | of this software and associated documentation files (the "Software"), to deal |
@@ -95,7 +95,7 @@ such as applying the templates to produce the website, converting the changelog |
95 | 95 | </sequential> |
96 | 96 | </macrodef> |
97 | 97 |
|
98 | | - <target name="website.release-build" depends="version, -website.clean, compile.support"> |
| 98 | + <target name="website.release-build" depends="version, -website.clean, javadoc.build, compile.support"> |
99 | 99 | <website.make version="${lombok.version}" fullversion="${lombok.fullversion}" cmd="all-newrelease" /> |
100 | 100 | </target> |
101 | 101 |
|
@@ -129,27 +129,54 @@ such as applying the templates to produce the website, converting the changelog |
129 | 129 | </java> |
130 | 130 | </target> |
131 | 131 |
|
132 | | - <target name="website.pack" depends="website.build"> |
133 | | - <mkdir dir="dist" /> |
134 | | - <tar destfile="dist/website.tar.bz2" compression="bzip2"> |
135 | | - <tarfileset dir="build/website" excludes="download-edge.html" /> |
136 | | - </tar> |
| 132 | + <target name="-website.init-hostgit"> |
| 133 | + <property name="loc.hostingGit" location="../website-cloudflare" /> |
| 134 | + <fail> |
| 135 | + You need the website-cloudflare repo as a sibling to your lombok repo to publish the website. |
| 136 | + <condition> |
| 137 | + <not><available file="${loc.hostingGit}/.git" /></not> |
| 138 | + </condition> |
| 139 | + </fail> |
137 | 140 | </target> |
138 | 141 |
|
139 | | - <target name="website.publish" depends="website.pack" description="Builds the website, compresses it, sends it to the projectlombok.org server and deploys it"> |
140 | | - <ivy:scpUpload |
141 | | - from="dist/website.tar.bz2" |
142 | | - to="/data/lombok/staging" |
143 | | - server="projectlombok.org" |
144 | | - username="${ssh.username}" |
145 | | - keyfile="${ssh.keyfile}" |
146 | | - knownHosts="ssh.knownHosts" /> |
147 | | - <ivy:sshExec |
148 | | - cmd="/data/lombok/stagingCmd/deployWebsite" |
149 | | - server="projectlombok.org" |
150 | | - username="${ssh.username}" |
151 | | - keyfile="${ssh.keyfile}" |
152 | | - knownHosts="ssh.knownHosts" /> |
| 142 | + <target name="-website.copyto-hostgit"> |
| 143 | + <sync todir="${loc.hostingGit}/website"> |
| 144 | + <fileset dir="build/website" /> |
| 145 | + </sync> |
| 146 | + </target> |
| 147 | + |
| 148 | + <target name="-website.pull-hostgit" depends="deps, -website.init-hostgit"> |
| 149 | + <exec executable="${exe.git}" failonerror="true" dir="${loc.hostingGit}"> |
| 150 | + <arg value="pull" /> |
| 151 | + </exec> |
| 152 | + </target> |
| 153 | + |
| 154 | + <target name="-website.commit-and-push-hostgit"> |
| 155 | + <exec executable="${exe.git}" failonerror="true" dir="${loc.hostingGit}"> |
| 156 | + <arg value="add" /> |
| 157 | + <arg value="-A" /> |
| 158 | + </exec> |
| 159 | + <exec executable="${exe.git}" failonerror="true" dir="${loc.hostingGit}"> |
| 160 | + <arg value="commit" /> |
| 161 | + <arg value="-m" /> |
| 162 | + <arg value="website update" /> |
| 163 | + </exec> |
| 164 | + <exec executable="${exe.git}" failonerror="true" dir="${loc.hostingGit}"> |
| 165 | + <arg value="push" /> |
| 166 | + </exec> |
| 167 | + </target> |
| 168 | + |
| 169 | + <target name="website.publish" depends="-website.pull-hostgit, website.build, -website.copyto-hostgit" description="Builds the website and copies it to the git repo serving as source for the cloudflare-hosted projectlombok.org site"> |
| 170 | + <antcall target="-website.commit-and-push-hostgit" /> |
| 171 | + </target> |
| 172 | + |
| 173 | + <target name="website.release-publish" depends="dist, -website.pull-hostgit, website.release-build, -website.copyto-hostgit" description="Builds the website and copies it to the git repo serving as source for the cloudflare-hosted projectlombok.org site"> |
| 174 | + <sync todir="${loc.hostingGit}/api"> |
| 175 | + <fileset dir="doc/api" /> |
| 176 | + </sync> |
| 177 | + <echo file="${loc.hostingGit}/CURRENT_VERSION">${lombok.version}</echo> |
| 178 | + <copy file="dist/lombok-${lombok.version}.jar" todir="${loc.hostingGit}/releases" /> |
| 179 | + <antcall target="-website.commit-and-push-hostgit" /> |
153 | 180 | </target> |
154 | 181 |
|
155 | 182 | <target name="javadoc.build" description="Generates the javadoc" depends="version, compile" unless="skip.javadoc"> |
@@ -207,30 +234,6 @@ such as applying the templates to produce the website, converting the changelog |
207 | 234 | <echo append="true" file="doc/api/tag-search-index.js"></echo> |
208 | 235 | </target> |
209 | 236 |
|
210 | | - <target name="javadoc.pack" depends="javadoc.build"> |
211 | | - <mkdir dir="dist" /> |
212 | | - <tar destfile="dist/javadoc.tar.bz2" compression="bzip2"> |
213 | | - <tarfileset dir="build/api" /> |
214 | | - </tar> |
215 | | - <echo>File dist/javadoc.tar.bz2 is available</echo> |
216 | | - </target> |
217 | | - |
218 | | - <target name="javadoc.publish" depends="javadoc.pack"> |
219 | | - <ivy:scpUpload |
220 | | - from="dist/javadoc.tar.bz2" |
221 | | - to="/data/lombok/staging" |
222 | | - server="projectlombok.org" |
223 | | - username="${ssh.username}" |
224 | | - keyfile="${ssh.keyfile}" |
225 | | - knownHosts="ssh.knownHosts" /> |
226 | | - <ivy:sshExec |
227 | | - cmd="/data/lombok/stagingCmd/deployJavadoc" |
228 | | - server="projectlombok.org" |
229 | | - username="${ssh.username}" |
230 | | - keyfile="${ssh.keyfile}" |
231 | | - knownHosts="ssh.knownHosts" /> |
232 | | - </target> |
233 | | - |
234 | 237 | <target name="latest-changes.build" depends="compile.support, version" description="Creates the latest changes HTML file from the markdown in doc/changelog"> |
235 | 238 | <mkdir dir="build/website" /> |
236 | 239 | <java classname="lombok.website.WebsiteMaker" failonerror="true"> |
|
0 commit comments