You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2020/07/12 00:22:31 UTC

[freemarker] branch 2.3-gae updated (eedc075 -> b037465)

This is an automated email from the ASF dual-hosted git repository.

ddekany pushed a change to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git.


    from eedc075  Updated some test dependencies.
     new 26966a4  (Minor typos)
     new b037465  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.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                          |   7 +-
 build.xml                                          | 103 +--------------------
 ivy.xml                                            |   2 +-
 ivysettings.xml                                    |  40 +++-----
 .../freemarker/ext/beans/ClassIntrospector.java    |  16 ++--
 ...va => Java9InstrospectorBugWorkaroundTest.java} |   2 +-
 6 files changed, 28 insertions(+), 142 deletions(-)
 rename src/test/java/freemarker/ext/beans/{Java9InstrospectorBugWorkaround.java => Java9InstrospectorBugWorkaroundTest.java} (94%)


[freemarker] 01/02: (Minor typos)

Posted by dd...@apache.org.
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 26966a4157f3bc77a5b72d907ff4a71872bae398
Author: ddekany <dd...@apache.org>
AuthorDate: Sat Jun 27 16:19:43 2020 +0200

    (Minor typos)
---
 .../java/freemarker/ext/beans/ClassIntrospector.java     | 16 ++++++++--------
 ...und.java => Java9InstrospectorBugWorkaroundTest.java} |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/main/java/freemarker/ext/beans/ClassIntrospector.java b/src/main/java/freemarker/ext/beans/ClassIntrospector.java
index 36b2511..98580fc 100644
--- a/src/main/java/freemarker/ext/beans/ClassIntrospector.java
+++ b/src/main/java/freemarker/ext/beans/ClassIntrospector.java
@@ -819,21 +819,21 @@ class ClassIntrospector {
     // This is needed as java.bean.Introspector sometimes gives back a method that's actually not accessible,
     // as it's an override of an accessible method in a non-public subclass. While that's still a public method, calling
     // it directly via reflection will throw java.lang.IllegalAccessException, and we are supposed to call the overidden
-    // accessible method instead. Like, we migth get two PropertyDescriptor-s for the same property name, and only one
+    // accessible method instead. Like, we might get two PropertyDescriptor-s for the same property name, and only one
     // will have a reader method that we can actually call. So we have to find that method here.
-    // Furthermore, the return type of the inaccisable method is possibly different (more specific) than the return type
-    // of the overidden accessible method. Also Introspector behavior changed with Java 9, as earlier in such case the
-    // Introspector returned all variants of the method (so the accessible one was amongst them at least), while in
-    // Java 9 it apparently always returns one variant only, but that's sometimes (not sure if it's predictable) the
-    // inaccessbile one.
+    // Furthermore, the return type of the inaccessible method is possibly different (more specific) than the return
+    // type of the overridden accessible method. Also Introspector behavior changed with Java 9, as earlier in such
+    // case the Introspector returned all variants of the method (so the accessible one was amongst them at least),
+    // while in Java 9 it apparently always returns one variant only, but that's sometimes (not sure if it's
+    // predictable) the inaccessible one.
     private static Method getMatchingAccessibleMethod(Method m, Map<ExecutableMemberSignature, List<Method>> accessibles) {
         if (m == null) {
             return null;
         }
         List<Method> ams = accessibles.get(new ExecutableMemberSignature(m));
-        // Certainly we could return any of the accessbiles, as Java reflection will call the correct override of the
+        // Certainly we could return any of the accessibles, as Java reflection will call the correct override of the
         // method anyway. There's an ambiguity when the return type is "overloaded", but in practice it probably doesn't
-        // matter which variant we call. Though, technically, they could do totaly different things. So, to avoid any
+        // matter which variant we call. Though, technically, they could do totally different things. So, to avoid any
         // corner cases that cause problems after an upgrade, we make an effort to give same result as before 2.3.31.
         return ams != null ? _MethodUtil.getMethodWithClosestNonSubReturnType(m.getReturnType(), ams) : null;
     }
diff --git a/src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaround.java b/src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaroundTest.java
similarity index 94%
rename from src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaround.java
rename to src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaroundTest.java
index 05fa695..0201b41 100644
--- a/src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaround.java
+++ b/src/test/java/freemarker/ext/beans/Java9InstrospectorBugWorkaroundTest.java
@@ -27,7 +27,7 @@ import org.junit.Test;
 import freemarker.template.TemplateException;
 import freemarker.test.TemplateTest;
 
-public class Java9InstrospectorBugWorkaround extends TemplateTest {
+public class Java9InstrospectorBugWorkaroundTest extends TemplateTest {
 
     @Test
     public void test() throws IOException, TemplateException {


[freemarker] 02/02: 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.

Posted by dd...@apache.org.
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 <dd...@apache.org>
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>