Skip to content

Commit 1407350

Browse files
committed
Harden tests and fix 2-compose
1 parent d912351 commit 1407350

File tree

5 files changed

+52
-37
lines changed

5 files changed

+52
-37
lines changed
Binary file not shown.

example/androidlib/kotlin/2-compose/build.mill

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,40 @@ object app extends AndroidAppKotlinModule {
2727
def androidCompileSdk = 35
2828
def androidMinSdk = 26
2929
def androidEnableCompose = true
30+
31+
def androidReleaseKeyName: Option[String] = Some("releaseKey.jks")
32+
def androidReleaseKeyAlias: T[Option[String]] = Task { Some("releaseKey") }
33+
def androidReleaseKeyPass: T[Option[String]] = Task { Some("MillBuildTool") }
34+
def androidReleaseKeyStorePass: T[Option[String]] = Task { Some("MillBuildTool") }
3035
def androidIsDebug = true
3136

3237
def androidApplicationId = "com.example.composetest"
3338
def androidApplicationNamespace = "com.example.composetest"
3439

3540
def mvnDeps: T[Seq[Dep]] = Seq(
3641
mvn"androidx.core:core-ktx:1.15.0",
37-
mvn"androidx.activity:activity-compose:1.9.3",
38-
mvn"androidx.compose.ui:ui:1.7.5",
39-
mvn"androidx.compose.material3:material3:1.3.1"
42+
mvn"androidx.appcompat:appcompat:1.7.0",
43+
mvn"androidx.annotation:annotation:1.9.1",
44+
mvn"androidx.compose:compose-bom:2024.12.01",
45+
mvn"androidx.activity:activity-compose:1.10.0",
46+
mvn"androidx.compose.foundation:foundation:1.7.6",
47+
mvn"androidx.compose.animation:animation-core:1.7.6",
48+
mvn"androidx.compose.foundation:foundation-layout:1.7.6",
49+
mvn"androidx.compose.animation:animation:1.7.6",
50+
mvn"androidx.compose.material3:material3:1.3.1",
51+
mvn"androidx.compose.ui:ui-tooling-preview:1.7.6",
52+
mvn"androidx.compose.ui:ui:1.7.6",
53+
mvn"androidx.compose.ui:ui-unit:1.7.6",
54+
mvn"androidx.compose.ui:ui-text:1.7.6",
55+
mvn"androidx.emoji2:emoji2:1.3.0",
56+
mvn"androidx.compose.ui:ui-graphics:1.7.6",
57+
mvn"androidx.lifecycle:lifecycle-common:2.8.7",
58+
mvn"androidx.lifecycle:lifecycle-process:2.8.7",
59+
mvn"androidx.lifecycle:lifecycle-runtime-compose:2.8.7",
60+
mvn"androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7",
61+
mvn"androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7",
62+
mvn"androidx.customview:customview-poolingcontainer:1.0.0",
63+
mvn"androidx.tracing:tracing:1.2.0"
4064
)
4165

4266
}
@@ -48,6 +72,30 @@ object app extends AndroidAppKotlinModule {
4872
> ./mill show app.androidApk
4973
".../out/app/androidApk.dest/app.apk"
5074

75+
76+
> ./mill show app.createAndroidVirtualDevice
77+
...Name: test, DeviceId: medium_phone...
78+
79+
> ./mill show app.startAndroidEmulator
80+
81+
> ./mill show app.androidInstall
82+
...All files should be loaded. Notifying the device...
83+
84+
> ./mill show app.androidRun --activity com.example.composetest.MainActivity
85+
[
86+
"Starting: Intent { cmp=com.example.composetest/.MainActivity }",
87+
"Status: ok",
88+
"LaunchState: COLD",
89+
"Activity: com.example.composetest/.MainActivity",
90+
"TotalTime: ...",
91+
"WaitTime: ...",
92+
"Complete"
93+
]
94+
95+
> ./mill show app.stopAndroidEmulator
96+
97+
> ./mill show app.deleteAndroidVirtualDevice
98+
5199
*/
52100

53101
// This command triggers the build process, which installs the necessary build components, compiles the Kotlin

example/thirdparty/androidtodo/build.mill

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ object app extends AndroidAppKotlinModule with AndroidBuildConfig with AndroidHi
6464
mvn"com.google.dagger:hilt-android:2.56",
6565
mvn"androidx.hilt:hilt-navigation-compose:1.2.0",
6666
mvn"com.google.accompanist:accompanist-swiperefresh:0.36.0",
67-
mvn"androidx.compose:compose-bom:2024.12.01",
6867
mvn"androidx.customview:customview-poolingcontainer:1.0.0",
6968
mvn"androidx.tracing:tracing:1.2.0"
7069
)

libs/androidlib/src/mill/androidlib/AndroidAppModule.scala

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -830,14 +830,6 @@ trait AndroidAppModule extends AndroidModule { outer =>
830830
)
831831
}
832832

833-
/**
834-
* Provides the output path for the generated main-dex list file, which is used
835-
* during the DEX generation process.
836-
*/
837-
def mainDexListOutput: T[Option[PathRef]] = Task {
838-
Some(androidModuleGeneratedDexVariants().mainDexListOutput)
839-
}
840-
841833
/** ProGuard/R8 rules configuration files for release target (user-provided and generated) */
842834
def androidProguardReleaseConfigs: T[Seq[PathRef]] = Task {
843835
val proguardFilesFromReleaseSettings = androidReleaseSettings().proguardFiles
@@ -1032,14 +1024,6 @@ trait AndroidAppModule extends AndroidModule { outer =>
10321024
"--dex"
10331025
)
10341026

1035-
// Multi-dex arguments (if any are provided)
1036-
val multiDexArgs =
1037-
mainDexRules().toSeq.flatMap(r => Seq("--main-dex-rules", r.path.toString)) ++
1038-
mainDexList().toSeq.flatMap(l => Seq("--main-dex-list", l.path.toString)) ++
1039-
mainDexListOutput().toSeq.flatMap(l => Seq("--main-dex-list-output", l.path.toString))
1040-
1041-
r8ArgsBuilder ++= multiDexArgs
1042-
10431027
// Baseline profile rewriting arguments, if a baseline profile is provided.
10441028
val baselineArgs = baselineProfile().map { bp =>
10451029
Seq("--art-profile", bp.path.toString, baselineOutOpt.toString)
@@ -1221,7 +1205,7 @@ trait AndroidAppModule extends AndroidModule { outer =>
12211205
}
12221206

12231207
override def androidPackagedDeps: T[Seq[PathRef]] = Task {
1224-
resolvedRunMvnDeps()
1208+
androidResolvedRunMvnDeps()
12251209
}
12261210

12271211
/**

libs/androidlib/src/mill/androidlib/AndroidModule.scala

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -529,22 +529,6 @@ trait AndroidModule extends JavaModule {
529529
androidSdkModule().androidLibsClasspaths()
530530
}
531531

532-
/**
533-
* Specifies the path to the main-dex rules file, which contains ProGuard rules
534-
* for determining which classes should be included in the primary DEX file.
535-
*/
536-
def mainDexRules: T[Option[PathRef]] = Task {
537-
Some(PathRef(androidCompiledResources()._1.path / "main-dex-rules.pro"))
538-
}
539-
540-
/**
541-
* Returns the path to the main-dex list file, which explicitly lists the classes
542-
* to be included in the primary DEX file. Currently, this is not defined.
543-
*/
544-
def mainDexList: T[Option[PathRef]] = Task {
545-
None
546-
}
547-
548532
/** Optional baseline profile for ART rewriting */
549533
def baselineProfile: T[Option[PathRef]] = Task {
550534
None

0 commit comments

Comments
 (0)