Skip to content

Commit

Permalink
fix: Fixed compatibility with android gradle plugin
Browse files Browse the repository at this point in the history
Fixes #240
  • Loading branch information
JBou committed Sep 9, 2024
1 parent 2758293 commit dc173a1
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,10 @@ protected void configureInstallPackageManagerTask(final InstallPackageManagerTas
.getPackageManagerSpecificationFile()
.set(resolvePackageManagerTaskProvider.flatMap(
ResolvePackageManagerTask::getPackageManagerSpecificationFile));
task
.getPackageManagerExecutableFile()
.fileProvider(resolvePackageManagerTaskProvider
.flatMap(ResolvePackageManagerTask::getPackageManagerExecutablePathFile)
.map(f -> {
final Path filePath = f.getAsFile().toPath();
task.getPackageManagerExecutableFile().fileProvider(resolvePackageManagerTaskProvider.flatMap(t ->
t.getProject().provider(() -> {
File packageManagerExecutablePathFile = t.getPackageManagerExecutablePathFile().getAsFile().get();
final Path filePath = packageManagerExecutablePathFile.toPath();
if (!Files.exists(filePath)) {
// Setting the output property to null avoids automatic creation of any parent directory by
// Gradle if the task is not skipped. If it is skipped, the file system would not have been
Expand All @@ -502,15 +500,13 @@ protected void configureInstallPackageManagerTask(final InstallPackageManagerTas
}
final BeanRegistry beanRegistry = beanRegistryBuildServiceProvider.get().getBeanRegistry();
try {
return Paths
.get(getBeanOrFail(beanRegistry, FileManager.class).readString(filePath,
StandardCharsets.UTF_8))
.toFile();
return Paths.get(getBeanOrFail(beanRegistry, FileManager.class).readString(filePath,
StandardCharsets.UTF_8)).toFile();
} catch (final IOException e) {
throw new GradleException(
"Cannot read path to package manager executable from file: " + filePath, e);
"Cannot read path to package manager executable from file: " + filePath, e);
}
}));
})));
task.getVerboseModeEnabled().set(frontendExtension.getVerboseModeEnabled());
bindSystemArchPropertiesToTaskInputs(systemProviders, task.getSystemJvmArch(), task.getSystemOsName());
// The task is skipped when there's no package.json file. It allows to define a project that installs only a
Expand Down

0 comments on commit dc173a1

Please sign in to comment.