This is an automated email from the ASF dual-hosted git repository. ddekany pushed a commit to branch 2.3-gae in repository https://gitbox.apache.org/repos/asf/freemarker.git
commit b037465350db2ee597bfeca9e406e9ffcf1e43ba Author: ddekany <[email protected]> AuthorDate: Sun Jul 12 02:22:24 2020 +0200 Build: Significantly simplified dependency management; no update-deps and such anymore, just bare-bone Ivy, and we are only using well known Maven repositories to retrieve artifacts (local, Central, and apache-staging, in this order). We don't use our own Ivy repo (hosted on our website) anymore. Switched to use the new freemarker-docgen Maven artifact, instead of the earlier one that came from our Ivy repo, and wasn't a Maven artifact. --- README.md | 7 ++-- build.xml | 103 +++----------------------------------------------------- ivy.xml | 2 +- ivysettings.xml | 40 +++++++--------------- 4 files changed, 19 insertions(+), 133 deletions(-) diff --git a/README.md b/README.md index d8197cb..e69905c 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ the source code repository. See repository locations here: https://freemarker.apache.org/sourcecode.html You need JDK 8 (not JDK 9!), Apache Ant (tested with 1.9.6) and Ivy (tested -with 2.4.0) to be installed. To install Ivy (but be sure it's not already +with 2.5.0) to be installed. To install Ivy (but be sure it's not already installed), issue `ant download-ivy`; it will copy Ivy under `~/.ant/lib`. (Alternatively, you can copy `ivy-<version>.jar` into the Ant home `lib` subfolder manually.) @@ -118,10 +118,7 @@ succeeds without the build.properties file too.) To build `freemarker.jar`, just issue `ant` in the project root directory, and it should download all dependencies automatically and build `freemarker.jar`. - -If later you change the dependencies in `ivy.xml`, or otherwise want to -re-download some of them, it will not happen automatically anymore, and you -must issue `ant update-deps`. +(Depencies will be cached into the `.ivy/cache` subdirectory of the project.) To test your build, issue `ant test`. diff --git a/build.xml b/build.xml index b1adffc..70dbf81 100644 --- a/build.xml +++ b/build.xml @@ -113,17 +113,11 @@ <delete dir="build/coverage/classes" /> </target> - <condition property="deps.available"> - <available file=".ivy" /> - </condition> - - <target name="init" depends="_autoget-deps" - description="Fetch dependencies if any are missing and create the build directory if necessary" - > + <target name="init"> <mkdir dir="build"/> </target> - <property name="ivy.install.version" value="2.4.0" /> + <property name="ivy.install.version" value="2.5.0" /> <property name="ivy.home" value="${user.home}/.ant" /> <property name="ivy.jar.dir" value="${ivy.home}/lib" /> <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> @@ -579,7 +573,7 @@ <attribute name="locale" /> <sequential> <ivy:cachepath conf="manual" pathid="ivy.dep" /> - <taskdef resource="org/freemarker/docgen/antlib.properties" + <taskdef resource="org/freemarker/docgen/ant/antlib.properties" uri="http://freemarker.org/docgen" classpathref="ivy.dep" /> @@ -957,7 +951,7 @@ Proceed? </input> <!-- ================================================================= --> <target name="ci" - depends="clean, update-deps, jar, test, javadoc" + depends="clean, jar, test, javadoc" description="CI should invoke this task" /> @@ -965,95 +959,6 @@ Proceed? </input> <!-- Dependency management (keep it exactly identical for all projects) --> <!-- ================================================================== --> - <target name="_autoget-deps" unless="deps.available"> - <antcall target="_autoget-deps-condition-workaround" /> - </target> - - <!-- - Called with antcall to ensure that deps.available will be up-to-date. - Without this trick, if ant is called with multiple tasks, the local .ivy - directory might ends up corrupted if it was created by the 1st task. - --> - <target name="_autoget-deps-condition-workaround" unless="deps.available"> - <antcall target="update-deps" /> - </target> - - <target name="update-deps" - description="Gets the latest version of the dependencies from the Web" - > - <echo>Getting dependencies...</echo> - <echo>-------------------------------------------------------</echo> - <ivy:settings id="remote" url="https://freemarker.apache.org/repos/ivy/ivysettings-remote.xml" /> - <!-- Build an own repository that will serve us even offline: --> - <ivy:retrieve settingsRef="remote" sync="true" - ivypattern=".ivy.part/repo/[organisation]/[module]/ivy-[revision].xml" - pattern=".ivy.part/repo/[organisation]/[module]/[artifact]-[revision].[ext]" - /> - <echo>-------------------------------------------------------</echo> - <echo>*** Successfully acquired dependencies from the Web ***</echo> - <echo>Eclipse users: Now right-click on ivy.xml and Resolve! </echo> - <echo>-------------------------------------------------------</echo> - <!-- Only now that we got all the dependencies will we delete anything. --> - <!-- Thus a net or repo outage doesn't left us without the dependencies. --> - - <!-- Save the resolution cache from the soon coming <delete>: --> - <move todir=".ivy.part/update-deps-reso-cache"> - <fileset dir=".ivy/update-deps-reso-cache" /> - </move> - <!-- Drop all the old stuff: --> - <delete dir=".ivy" /> - <!-- And use the new stuff instead: --> - <move todir=".ivy"> - <fileset dir=".ivy.part" /> - </move> - </target> - - <!-- Do NOT call this from 'clean'; offline guys would stuck after that. --> - <target name="clean-deps" - description="Deletes all dependencies" - > - <delete dir=".ivy" /> - </target> - - <target name="publish-override" depends="jar" - description="Ivy-publishes THIS project locally as an override" - > - <ivy:resolve /> - <ivy:publish - pubrevision="${moduleBranch}-branch-head" - artifactspattern="build/[artifact].[ext]" - overwrite="true" forcedeliver="true" - resolver="freemarker-devel-local-override" - > - <artifact name="freemarker" type="jar" ext="jar" /> - </ivy:publish> - <delete file="build/ivy.xml" /> <!-- ivy:publish makes this --> - <echo>-------------------------------------------------------</echo> - <echo>*** Don't forget to `ant unpublish-override` later! ***</echo> - </target> - - <target name="unpublish-override" - description="Undoes publish-override (made in THIS project)" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override/${moduleOrg}/${moduleName}" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache/${moduleOrg}/${moduleName}" /> - </target> - - <target name="unpublish-override-all" - description="Undoes publish-override-s made in ALL projects" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache" /> - </target> - - <target name="uninstall" - description="Deletes external files created by FreeMarker developement" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-cache" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache " /> - </target> - <target name="report-deps" description="Creates a HTML document that summarizes the dependencies." > diff --git a/ivy.xml b/ivy.xml index 251ec1b..3778f96 100644 --- a/ivy.xml +++ b/ivy.xml @@ -164,7 +164,7 @@ <!-- docs --> - <dependency org="org.freemarker" name="docgen" rev="2.0-branch-head" conf="manual->default" changing="true" /> + <dependency org="org.apache.freemarker.docgen" name="freemarker-docgen-ant" rev="0.0.1" conf="manual->default" changing="true" /> <!-- parser --> diff --git a/ivysettings.xml b/ivysettings.xml index 3369274..0748bf1 100644 --- a/ivysettings.xml +++ b/ivysettings.xml @@ -18,37 +18,21 @@ --> <ivysettings> - <!-- Prevent IvyDE error: --> - <property name="server.ivy.repo.root" value="${ivy.project.dir}/NOT_SET" override="false" /> - + <!-- As we use our own resolved, we rather don't use the user level Ivy cache: --> <caches defaultCacheDir="${ivy.project.dir}/.ivy/cache"> - <cache name="cacheForPrivate" useOrigin="true" defaultTTL="1s" /> - - <!-- - Rather don't use useOrigin="true" here, as deleting from the target repo breaks the cache then. - --> - <cache name="cacheForLocalOverride" - basedir="${user.home}/.ivy2/freemarker-devel-local-override-cache" - defaultTTL="1s" lockStrategy="artifact-lock" - /> + <cache name="freemarkerCache" useOrigin="true" /> </caches> + + <settings defaultResolver="default" /> + <property name="localMaveRepoDir" value="${user.home}/.m2/repository/" /> <resolvers> - <chain name="freemarker-devel-local" returnFirst="true"> - <filesystem name="freemarker-devel-local-override" cache="cacheForLocalOverride"> - <ivy pattern="${user.home}/.ivy2/freemarker-devel-local-override/[organisation]/[module]/ivy-[revision].xml" /> - <artifact pattern="${user.home}/.ivy2/freemarker-devel-local-override/[organisation]/[module]/[artifact]-[revision].[ext]" /> - </filesystem> - <filesystem name="project-private" cache="cacheForPrivate"> - <ivy pattern="${ivy.project.dir}/.ivy/repo/[organisation]/[module]/ivy-[revision].xml" /> - <artifact pattern="${ivy.project.dir}/.ivy/repo/[organisation]/[module]/[artifact]-[revision].[ext]" /> + <chain name="default"> + <filesystem name="mavenLocal" m2compatible="true"> + <artifact pattern="${localMaveRepoDir}/[organisation]/[module]/[revision]/[module]-[revision].[ext]" /> + <ivy pattern="${localMaveRepoDir}/[organisation]/[module]/[revision]/[module]-[revision].pom" /> </filesystem> - </chain> - <filesystem name="server-publishing-target"> - <ivy pattern="${server.ivy.repo.root}/[organisation]/[module]/ivy-[revision].xml" /> - <artifact pattern="${server.ivy.repo.root}/[organisation]/[module]/[artifact]-[revision].[ext]" /> - </filesystem> + <ibiblio name="mavenCentral" m2compatible="true" /> + <ibiblio name="mavenApacheStaging" m2compatible="true" root="https://repository.apache.org/content/repositories/staging/" /> + </chain> </resolvers> - <modules> - <module organisation="*" resolver="freemarker-devel-local" /> - </modules> </ivysettings>
