Thank you Martijn, your commit does indeed fixes the issues I was
running into.

On 25/08/19 3:18 PM, Martijn Kruithof wrote:
> This still leaves an issue,
>
> If ant is run using java 8 and an external compiler java 11 is used,
> the correct compiler version is not determined, this is also the case
> in the ant 1.10.6 release.

Do you mean using the "executable" attribute of the javac task to point
to an external compiler?

-Jaikiran


>
> On 25-08-19 11:44, j...@apache.org wrote:
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> jkf pushed a commit to branch master
>> in repository https://gitbox.apache.org/repos/asf/ant.git
>>
>>
>> The following commit(s) were added to refs/heads/master by this push:
>>       new aac25de  Fixed regression on javac version selection in
>> case build.compiler property is set.
>>       new 5387d84  Merge branch 'master' of
>> https://gitbox.apache.org/repos/asf/ant
>> aac25de is described below
>>
>> commit aac25de91c3301f445445dea835cdfe5f9121891
>> Author: jkf <j...@famkruithof.net>
>> AuthorDate: Sun Aug 25 11:42:58 2019 +0200
>>
>>      Fixed regression on javac version selection in case
>> build.compiler property is set.
>> ---
>>   .../taskdefs/compilers/DefaultCompilerAdapter.java | 22
>> +++++++++++++++-------
>>   1 file changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git
>> a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
>> b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
>>
>> index c996e38..ec2d9d8 100644
>> ---
>> a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
>> +++
>> b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
>> @@ -796,8 +796,7 @@ public abstract class DefaultCompilerAdapter
>>        */
>>       @Deprecated
>>       protected boolean assumeJava9() {
>> -        return assumeJavaXY("javac1.9", JavaEnvUtils.JAVA_9)
>> -                || assumeJavaXY("javac9", JavaEnvUtils.JAVA_9);
>> +        return assumeJava9Plus() && !assumeJava10Plus();
>>       }
>>         /**
>> @@ -806,9 +805,9 @@ public abstract class DefaultCompilerAdapter
>>        * @since Ant 1.10.2
>>        */
>>       protected boolean assumeJava9Plus() {
>> -        return "javac1.9".equals(attributes.getCompilerVersion())
>> -            || "javac9".equals(attributes.getCompilerVersion())
>> -            || assumeJava10Plus();
>> +        return assumeJavaXY("javac1.9", JavaEnvUtils.JAVA_9)
>> +                || assumeJavaXY("javac9", JavaEnvUtils.JAVA_9)
>> +                || assumeJava10Plus();
>>       }
>>         /**
>> @@ -817,7 +816,11 @@ public abstract class DefaultCompilerAdapter
>>        * @since Ant 1.10.7
>>        */
>>       protected boolean assumeJava10Plus() {
>> -        return "javac10+".equals(attributes.getCompilerVersion());
>> +        return "javac10+".equals(attributes.getCompilerVersion())
>> +                ||
>> (JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_10)
>> +                    &&
>> ("classic".equals(attributes.getCompilerVersion())
>> +                    || "modern".equals(attributes.getCompilerVersion())
>> +                    ||
>> "extJavac".equals(attributes.getCompilerVersion())));
>>       }
>>             /**
>> @@ -825,7 +828,12 @@ public abstract class DefaultCompilerAdapter
>>        * @since Ant 1.8.3
>>        */
>>       private boolean assumeJavaXY(final String javacXY, final String
>> javaEnvVersionXY) {
>> -        return javacXY.equals(attributes.getCompilerVersion());
>> +        String compilerVersion = attributes.getCompilerVersion();
>> +        return javacXY.equals(compilerVersion) ||
>> +                (JavaEnvUtils.isJavaVersion(javaEnvVersionXY)
>> +                        && ("classic".equals(compilerVersion)
>> +                        || "modern".equals(compilerVersion)
>> +                        || "extJavac".equals(compilerVersion)));
>>       }
>>         /**
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to