diff --git a/CHANGELOG.md b/CHANGELOG.md index 548bb1f..a9af6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Recommended minimum Gradle version is now 8.8. +### Fixed +- Address configuration cache problems. + ## [0.4.0] - 2024-05-07 ### Added - Allow to filter out translated files when copying them. diff --git a/src/main/java/org/zaproxy/gradle/crowdin/tasks/CopyProjectTranslations.java b/src/main/java/org/zaproxy/gradle/crowdin/tasks/CopyProjectTranslations.java index 7d753de..36a8c20 100644 --- a/src/main/java/org/zaproxy/gradle/crowdin/tasks/CopyProjectTranslations.java +++ b/src/main/java/org/zaproxy/gradle/crowdin/tasks/CopyProjectTranslations.java @@ -62,7 +62,7 @@ public void from(String dir) { @TaskAction void copy() { CrowdinConfiguration configuration = getCrowdinConfiguration(); - Path baseDir = getProject().getProjectDir().toPath(); + Path baseDir = getProjectLayout().getProjectDirectory().getAsFile().toPath(); Path packagesDir = getTranslationsPackageDirectory().getAsFile().get().toPath(); TranslationsCopier copier = diff --git a/src/main/java/org/zaproxy/gradle/crowdin/tasks/CrowdinTask.java b/src/main/java/org/zaproxy/gradle/crowdin/tasks/CrowdinTask.java index ea15bf4..b2f5da4 100644 --- a/src/main/java/org/zaproxy/gradle/crowdin/tasks/CrowdinTask.java +++ b/src/main/java/org/zaproxy/gradle/crowdin/tasks/CrowdinTask.java @@ -32,7 +32,9 @@ import java.util.Collections; import java.util.List; import java.util.function.Function; +import javax.inject.Inject; import org.gradle.api.DefaultTask; +import org.gradle.api.file.ProjectLayout; import org.gradle.api.file.RegularFileProperty; import org.gradle.api.provider.MapProperty; import org.gradle.api.provider.Property; @@ -64,6 +66,11 @@ protected CrowdinTask() { getConfigurationTokens().convention(Collections.emptyMap()); } + @Inject + protected ProjectLayout getProjectLayout() { + throw new UnsupportedOperationException(); + } + @Input public abstract Property getAuthToken(); @@ -118,7 +125,9 @@ protected R apiRequest(Function access) { protected LocalVfs createLocalVfs(CrowdinProject crowdinProject) { try { return new LocalVfs( - getProject().getProjectDir().toPath(), crowdinProject, getSimpleLogger()); + getProjectLayout().getProjectDirectory().getAsFile().toPath(), + crowdinProject, + getSimpleLogger()); } catch (IOException e) { throw new CrowdinPluginException( "An error occurred while enumerating the local files, cause: " + e.getMessage(),