Skip to content

Commit

Permalink
Fix AOT plugin breaking the nativeCompile task (#782)
Browse files Browse the repository at this point in the history
Fixes #781
  • Loading branch information
melix authored Jul 17, 2023
1 parent 2e7c023 commit 30cd61a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private void registerJavaExecOptimizedRun(Project project,
conf.setCanBeConsumed(false);
conf.setCanBeConsumed(true);
// Use the same attributes as runtimeClasspath for resolution
AttributeUtils.copyAttributes(conf, runtimeClasspath);
AttributeUtils.copyAttributes(runtimeClasspath, conf);
});

tasks.register("optimizedRun", JavaExec.class, task -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.micronaut.gradle.aot

import io.micronaut.gradle.AbstractGradleBuildSpec
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Issue
import spock.lang.Requires

class BasicMicronautAOTSpec extends AbstractAOTPluginSpec {

Expand Down Expand Up @@ -153,4 +155,20 @@ class BasicMicronautAOTSpec extends AbstractAOTPluginSpec {
result.task(":prepareJitOptimizations").outcome == TaskOutcome.SUCCESS
}

@Requires({ AbstractGradleBuildSpec.graalVmAvailable && !os.windows })
def "can compile standard and optimized native apps"() {
withSample("aot/basic-app")
withPlugins(Plugins.APPLICATION)

when:
def result = build(task)

then:
result.task(":$task").outcome == TaskOutcome.SUCCESS

where:
task << ["nativeCompile", "nativeOptimizedCompile"]

}

}

0 comments on commit 30cd61a

Please sign in to comment.