This repository was archived by the owner on Oct 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathAndroidKeys.scala
197 lines (162 loc) · 8.83 KB
/
AndroidKeys.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import sbt._
import Keys._
/*!# Android Keys
`AndroidKeys` contains all the `SettingKey`s and `TaskKey`s for a standard
Android project.
*/
object AndroidKeys {
val Android= config("android") extend (Compile)
/** User Defines */
val platformName = SettingKey[String]("platform-name", "Targetted android platform")
val keyalias = SettingKey[String]("key-alias")
val versionCode = SettingKey[Int]("version-code")
val versionName = TaskKey[String]("version-name")
/** Proguard Settings */
val proguardOption = SettingKey[String]("proguard-option")
val proguardOptimizations = SettingKey[Seq[String]]("proguard-optimizations")
val libraryJarPath = SettingKey[Seq[File]]("library-path")
/** Default Settings */
val aaptName = SettingKey[String]("aapt-name")
val adbName = SettingKey[String]("adb-name")
val aidlName = SettingKey[String]("aidl-name")
val dxName = SettingKey[String]("dx-name")
val manifestName = SettingKey[String]("manifest-name")
val jarName = SettingKey[String]("jar-name")
val assetsDirectoryName = SettingKey[String]("assets-dir-name")
val resDirectoryName = SettingKey[String]("res-dir-name")
val classesMinJarName = SettingKey[String]("classes-min-jar-name")
val classesDexName = SettingKey[String]("classes-dex-name")
val resourcesApkName = SettingKey[String]("resources-apk-name")
val dxOpts = SettingKey[Tuple2[String, Option[Seq[String]]]]("dx-opts")
val manifestSchema = SettingKey[String]("manifest-schema")
val envs = SettingKey[Seq[String]]("envs")
val preinstalledModules = SettingKey[Seq[ModuleID]]("preinstalled-modules")
/** Determined Settings */
val packageApkName = TaskKey[String]("package-apk-name")
val packageApkLibName = TaskKey[String]("package-apklib-name")
val osDxName = SettingKey[String]("os-dx-name")
/** Path Settings */
val sdkPath = SettingKey[File]("sdk-path")
val toolsPath = SettingKey[File]("tools-path")
val dbPath = SettingKey[File]("db-path")
val platformPath = SettingKey[File]("platform-path")
val aaptPath = SettingKey[File]("apt-path")
val idlPath = SettingKey[File]("idl-path")
val dxPath = SettingKey[File]("dx-path")
/** Base Settings */
val platformToolsPath = SettingKey[File]("platform-tools-path")
val manifestPackage = TaskKey[String]("manifest-package")
val manifestPackageName = TaskKey[String]("manifest-package-name")
val minSdkVersion = TaskKey[Option[Int]]("min-sdk-version")
val maxSdkVersion = TaskKey[Option[Int]]("max-sdk-version")
val manifestPath = TaskKey[Seq[File]]("manifest-path")
val nativeLibrariesPath = SettingKey[File]("natives-lib-path")
val jarPath = SettingKey[File]("jar-path")
val mainAssetsPath = SettingKey[File]("main-asset-path")
val mainResPath = TaskKey[File]("main-res-path")
val managedJavaPath = SettingKey[File]("managed-java-path")
val managedNativePath = SettingKey[File]("managed-native-path")
val classesMinJarPath = SettingKey[File]("classes-min-jar-path")
val classesDexPath = SettingKey[File]("classes-dex-path")
val resourcesApkPath = SettingKey[File]("resources-apk-path")
val packageApkPath = TaskKey[File]("package-apk-path")
val packageApkLibPath = TaskKey[File]("package-apklib-path")
val useProguard = SettingKey[Boolean]("use-proguard")
val preserveServiceRegistry = SettingKey[Boolean]("preserve-service-registry")
val serviceRegistryInclude = SettingKey[Seq[String]]("service-registry-include")
val serviceRegistryExclude = SettingKey[Seq[String]]("service-registry-exclude")
/** Install Settings */
val packageConfig = TaskKey[ApkConfig]("package-config",
"Generates a Apk Config")
/** Typed Resource Settings */
val managedScalaPath = SettingKey[File]("managed-scala-path")
val typedResource = TaskKey[File]("typed-resource",
"""Typed resource file to be generated, also includes
interfaces to access these resources.""")
val layoutResources = TaskKey[Seq[File]]("layout-resources",
"""All files that are in res/layout. They will
be accessable through TR.layouts._""")
/** Market Publish Settings */
val keystorePath = SettingKey[File]("key-store-path")
val zipAlignPath = SettingKey[File]("zip-align-path", "Path to zipalign")
val packageAlignedName = TaskKey[String]("package-aligned-name")
val packageAlignedPath = TaskKey[File]("package-aligned-path")
/** Manifest Generator */
val manifestTemplateName = SettingKey[String]("manifest-template-name")
val manifestTemplatePath = SettingKey[File]("manifest-template-path")
/** Base Tasks */
case class LibraryProject(pkgName: String, manifest: File, sources: Set[File], resDir: Option[File], assetsDir: Option[File])
val apklibPackage = TaskKey[File]("apklib-package")
val extractApkLibDependencies = TaskKey[Seq[LibraryProject]]("apklib-dependencies", "Unpack apklib dependencies")
val copyNativeLibraries = TaskKey[Unit]("copy-native-libraries", "Copy native libraries added to libraryDependencies")
val apklibSources = TaskKey[Seq[File]]("apklib-sources", "Enumerate Java sources from apklibs")
val aaptGenerate = TaskKey[Seq[File]]("aapt-generate", "Generate R.java")
val aidlGenerate = TaskKey[Seq[File]]("aidl-generate",
"Generate Java classes from .aidl files.")
val proguardInJars = TaskKey[Seq[File]]("proguard-in-jars")
val proguardExclude = TaskKey[Seq[File]]("proguard-exclude")
val makeManagedJavaPath = TaskKey[Unit]("make-managed-java-path")
/** Installable Tasks */
val installEmulator = TaskKey[Unit]("install-emulator")
val uninstallEmulator = TaskKey[Unit]("uninstall-emulator")
val installDevice = TaskKey[Unit]("install-device")
val uninstallDevice = TaskKey[Unit]("uninstall-device")
val aaptPackage = TaskKey[File]("aapt-package",
"Package resources and assets.")
val packageDebug = TaskKey[File]("package-debug",
"Package and sign with a debug key.")
val packageRelease = TaskKey[File]("package-release", "Package without signing.")
val cleanApk = TaskKey[Unit]("clean-apk", "Remove apk package")
val proguard = TaskKey[Option[File]]("proguard", "Optimize class files.")
val dxInputs = TaskKey[Seq[File]]("dx-inputs", "Input for dex command")
val dx = TaskKey[File]("dx", "Convert class files to dex files")
val makeAssetPath = TaskKey[Unit]("make-assest-path")
/** Launch Tasks */
val startDevice = TaskKey[Unit]("start-device",
"Start package on device after installation")
val startEmulator = TaskKey[Unit]("start-emulator",
"Start package on emulator after installation")
/** ddm Support tasks */
val stopBridge = TaskKey[Unit]("stop-bridge",
"Terminates the ADB debugging bridge")
val screenshotEmulator = TaskKey[File]("screenshot-emulator",
"Take a screenshot from the emulator")
val screenshotDevice = TaskKey[File]("screenshot-device",
"Take a screenshot from the device")
// hprof tasks are Unit because of async nature
val hprofEmulator = TaskKey[Unit]("hprof-emulator",
"Take a dump of the current heap from the emulator")
val hprofDevice = TaskKey[Unit]("hprof-device",
"Take a dump of the current heap from the device")
val threadsEmulator = InputKey[Unit]("threads-emulator",
"Show thread dump from the emulator")
val threadsDevice = InputKey[Unit]("threads-device",
"Show thread dump from the device")
/** Market Publish tasks */
val prepareMarket = TaskKey[File]("prepare-market",
"Prepare asset for Market publication.")
val zipAlign = TaskKey[File]("zip-align", "Run zipalign on signed jar.")
val signRelease = TaskKey[File]("sign-release",
"Sign with key alias using key-alias and keystore path.")
val cleanAligned = TaskKey[Unit]("clean-aligned", "Remove zipaligned jar")
/** TypedResources Task */
val generateTypedResources = TaskKey[Seq[File]]("generate-typed-resources",
"""Produce a file TR.scala that contains typed
references to layout resources.""")
/** Manifest Generator tasks*/
val generateManifest = TaskKey[Seq[File]]("generate-manifest",
"""Generates a customized AndroidManifest.xml with
current build number and debug settings.""")
/** Test Project Tasks */
val testRunner = TaskKey[String]("test-runner", "get the current test runner")
val testEmulator = TaskKey[Unit]("test-emulator", "runs tests in emulator")
val testDevice = TaskKey[Unit]("test-device", "runs tests on device")
val testOnlyEmulator = InputKey[Unit]("test-only-emulator", "run a single test on emulator")
val testOnlyDevice = InputKey[Unit]("test-only-device", "run a single test on device")
/** Github tasks & keys */
val uploadGithub = TaskKey[Option[String]]("github-upload", "Upload file to github")
val deleteGithub = TaskKey[Unit]("github-delete", "Delete file from github")
val githubRepo = SettingKey[String]("github-repo", "Github repo")
val cachePasswords = SettingKey[Boolean]("cache-passwords", "Cache passwords")
val clearPasswords = TaskKey[Unit]("clear-passwords", "Clear cached passwords")
}