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

Support gradle Config Cache on Gradle 8 #2

Open
wants to merge 1 commit into
base: gradle-8
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion dart-sample-2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
// classpath fileTree(include: ['*.jar'], dir: 'libs')
classpath files('libs/henson-pluginx.jar')
// classpath files('libs/henson-pluginx.jar')
classpath files('../henson-plugin/build/libs/henson-plugin.jar')
// classpath "com.f2prateek.dart:henson-plugin:3.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Expand Down
2 changes: 2 additions & 0 deletions dart-sample-2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

org.gradle.configuration-cache.problems=warn
org.gradle.configuration-cache=true
#org.gradle.unsafe.configuration-cache=true
#org.gradle.unsafe.configuration-cache-problems=warn
2 changes: 1 addition & 1 deletion dart-sample-2/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
Binary file not shown.
Binary file removed dart-sample-2/libs/henson-pluginx.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,17 @@ public File getHensonNavigatorSourceFile() {
return new File(generatedFolder, "HensonNavigator.java");
}

BaseVariant variant;
// BaseVariant variant;
Project project;
FileCollection artifactCollection;
Logger logger;
TaskProvider<JavaCompile> javaCompiler;
// TaskProvider<JavaCompile> javaCompiler;
HensonNavigatorGenerator hensonNavigatorGenerator;

@TaskAction
public void generateHensonNavigator() {
FileCollection variantCompileClasspath = getJarDependencies();
FileCollection uft = (FileCollectionInternal) javaCompiler.get().getSource().plus(project.fileTree(destinationFolder));
// new UnionFileCollection(
// ,(FileCollectionInternal) javaCompiler.get().getSource(), (FileCollectionInternal) project.fileTree(destinationFolder));
javaCompiler.get().setSource(uft);

logger.debug("Analyzing configuration: " + variantCompileClasspath.getFiles());
Set<String> targetActivities = new HashSet<>();
Streams.stream(variantCompileClasspath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.attributes.AttributeContainer;
import org.gradle.api.file.FileCollection;
import org.gradle.api.internal.file.FileCollectionInternal;
import org.gradle.api.logging.Logger;
import org.gradle.api.tasks.TaskProvider;

Expand Down Expand Up @@ -67,6 +69,8 @@ public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGeneration
Action<AttributeContainer> attributes =
container ->
container.attribute(ARTIFACT_TYPE, AndroidArtifacts.ArtifactType.CLASSES.getType());
FileCollection uft = (FileCollectionInternal) variant.getJavaCompileProvider().get().getSource().plus(project.fileTree(destinationFolder));
variant.getJavaCompileProvider().get().setSource(uft);
TaskProvider<GenerateHensonNavigatorTask> generateHensonNavigatorTask =
project
.getTasks()
Expand All @@ -88,8 +92,9 @@ public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGeneration
.getArtifacts()
.getArtifactFiles();
generateHensonNavigatorTask1.destinationFolder = destinationFolder;
generateHensonNavigatorTask1.javaCompiler = variant.getJavaCompileProvider();
// generateHensonNavigatorTask1.javaCompiler = variant.getJavaCompileProvider();
generateHensonNavigatorTask1.logger = logger;

generateHensonNavigatorTask1.project = project;
generateHensonNavigatorTask1.hensonNavigatorGenerator =
hensonNavigatorGenerator;
Expand Down
2 changes: 1 addition & 1 deletion henson-plugin/src/main/resources/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Tue Jun 13 13:24:24 WIB 2023
#Mon Aug 28 19:54:52 WIB 2023
dart.version=unspecified