Skip to content

Commit

Permalink
Use a hybrid approach of task and global destination
Browse files Browse the repository at this point in the history
  • Loading branch information
vaslabs committed Jan 14, 2025
1 parent ca2d5fb commit b00d3e8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scalalib/src/mill/javalib/android/AndroidAppModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,13 @@ trait AndroidAppModule extends JavaModule {
emulator
}

private def androidDebugKeystore(): PathRef = {
private def androidDebugKeystore: Task[PathRef] = Task(persistent = true) {
val debugFileName = "mill-debug.jks"
// TODO maybe we need a file lock here
val debugKeystoreFile = os.home / ".android" / "mill-debug.jks"
val debugKeystoreFile = os.home / ".android" / debugFileName

if (!os.exists(debugKeystoreFile)) {
// TODO test on windows and mac and/or change implementation with java APIs
os.call((
"keytool",
"-genkeypair",
Expand All @@ -919,7 +922,11 @@ trait AndroidAppModule extends JavaModule {
debugKeyPass
))
}
PathRef(debugKeystoreFile)
val debugKeystoreTaskFile = T.dest / debugFileName

os.copy(debugKeystoreFile, debugKeystoreTaskFile)

PathRef(debugKeystoreTaskFile)
}

protected def androidKeystore: T[PathRef] = Task {
Expand Down

0 comments on commit b00d3e8

Please sign in to comment.