Skip to content

Commit

Permalink
Make ready for declarative conventions in NiA
Browse files Browse the repository at this point in the history
- Only apply NiASupport for NiA project - adjust expectations of non-NiA Android test projects.
  • Loading branch information
tresat committed May 20, 2024
1 parent 8c125b3 commit 08274dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion unified-prototype/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.9-20240518001543+0000-bin.zip
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.9-branch-gh_declarative_convention_rules-20240520154301+0000-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ androidApplication {
release {
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.2.2")
implementation("androidx.tracing:tracing-ktx:1.3.0-alpha02") // TODO: Is this necessary for minification(?) If so, this should be included automatically
}

minify {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ public void linkDslModelToPlugin(Project project, AndroidLibrary dslModel) {
configureHilt(project, dslModel, android);
configureCompose(project, dslModel, android);

NiaSupport.configureNia(project, dslModel);
if (Objects.equals(project.getRootProject().getName(), "nowinandroid")) {
NiaSupport.configureNia(project, dslModel);
}
}

@SuppressWarnings("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@

public class NiaSupport {
@SuppressWarnings("UnstableApiUsage")
public static void configureNia(Project project,
@SuppressWarnings("unused") AndroidLibrary dslModel) {
public static void configureNia(Project project, AndroidLibrary dslModel) {
LibraryExtension androidLib = project.getExtensions().getByType(LibraryExtension.class);
LibraryAndroidComponentsExtension androidLibComponents = project.getExtensions().getByType(LibraryAndroidComponentsExtension.class);

dslModel.getDependencies().getImplementation().add("androidx.tracing:tracing-ktx:1.3.0-alpha02");
dslModel.getTesting().getDependencies().getImplementation().add("org.jetbrains.kotlin:kotlin-test");

setTargetSdk(androidLib);
androidLib.setResourcePrefix(buildResourcePrefix(project));
configureFlavors(androidLib, (flavor, niaFlavor) -> {});
configureKotlin(project);

dslModel.getTesting().getDependencies().getImplementation().add("org.jetbrains.kotlin:kotlin-test");
dslModel.getDependencies().getImplementation().add("androidx.tracing:tracing-ktx:1.3.0-alpha02");

disableUnnecessaryAndroidTests(project, androidLibComponents);

configureGradleManagedDevices(androidLib);
Expand Down

0 comments on commit 08274dc

Please sign in to comment.