Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration caching when generating jar plugin trampoline script #509

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.gradle.api.Named
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.file.ProjectLayout
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.logging.LogLevel
Expand Down Expand Up @@ -88,6 +89,7 @@ public abstract class GenerateProtoTask extends DefaultTask {
private final ConfigurableFileCollection sourceFiles = objectFactory.fileCollection()
private final NamedDomainObjectContainer<PluginOptions> builtins = objectFactory.domainObjectContainer(PluginOptions)
private final NamedDomainObjectContainer<PluginOptions> plugins = objectFactory.domainObjectContainer(PluginOptions)
private final ProjectLayout projectLayout = project.layout

// These fields are set by the Protobuf plugin only when initializing the
// task. Ideally they should be final fields, but Gradle task cannot have
Expand Down Expand Up @@ -703,7 +705,7 @@ public abstract class GenerateProtoTask extends DefaultTask {
if (jarFileName.length() <= JAR_SUFFIX.length()) {
throw new GradleException(".jar protoc plugin path '${jarAbsolutePath}' has no file name")
}
File scriptExecutableFile = new File("${project.buildDir}/scripts/" +
File scriptExecutableFile = new File("${projectLayout.buildDirectory.get()}/scripts/" +
jarFileName[0..(jarFileName.length() - JAR_SUFFIX.length() - 1)] + "-${getName()}-trampoline." +
(isWindows ? "bat" : "sh"))
try {
Expand Down