sdedic opened a new pull request, #5899:
URL: https://github.com/apache/netbeans/pull/5899

   The 4.0 upcoming version of Micronaut  (now M2) uses an upgraded version of 
Kotlin gradle plugin that somewhat breaks its backward compatibility.
   According to 
[KT-32805](https://youtrack.jetbrains.com/issue/KT-32805/KotlinCompile-inherits-properties-sourceCompatibility-and-targetCompatibility-which-breaks-Gradles-incremental-compilation#focus=Comments-27-5915479.0-0),
 Kotlin compiler task used to inherit from `SourceTask` that has 
`sourceCompatibility` and `targetCompatibility` properties, but from version 
1.7 it derives just from DefaultTask.
   
   According to that report, the plugin ignored the *Compatibility properties 
even before that. The proper settings resided in `kotlinOptions` property.
   
   This resulted in 
   ```
   Reason: groovy.lang.MissingPropertyException: Could not get unknown property 
'sourceCompatibility' for task ':aop:compileKotlin' of type 
org.jetbrains.kotlin.gradle.tasks.KotlinCompile.
   groovy.lang.MissingPropertyException: Could not get unknown property 
'sourceCompatibility' for task ':aop:compileKotlin' of type 
org.jetbrains.kotlin.gradle.tasks.KotlinCompile.
        at 
org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:85)
        at 
org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:62)
        at org.gradle.api.internal.AbstractTask.property(AbstractTask.java:571)
        at org.gradle.api.DefaultTask.property(DefaultTask.java:169)
        at 
org.netbeans.modules.gradle.tooling.NbProjectInfoBuilder.detectSources(NbProjectInfoBuilder.java:1088)
   ```
   
   
   This PR makes the kotlinOptions the primary source for source/target version 
kotlinCompile task; falls back to the previous behaviour. In addition task 
properties are fetched by a safe helper that does not throw on a missing 
property. The procedure should be safe for all versions of Kotlin plugin: 
should they not expose kotlinOptions.{jvmTarget|languageLevel}, it will be 
(safely) taken from {source,target}Compatibility properties of the task.
   
   Fixes #5896 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to