mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Fix build-tools weird namings.
This commit is contained in:
parent
146905da40
commit
cb959403fa
1 changed files with 10 additions and 15 deletions
|
@ -55,29 +55,24 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler) :
|
||||||
val configurations = hashMapOf<String, AndroidConfig>()
|
val configurations = hashMapOf<String, AndroidConfig>()
|
||||||
|
|
||||||
fun setConfiguration(p: Project, config: AndroidConfig) {
|
fun setConfiguration(p: Project, config: AndroidConfig) {
|
||||||
configurations.put(p.name!!, config)
|
configurations.put(p.name, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun accept(project: Project) = configurations.containsKey(project.name!!)
|
override fun accept(project: Project) = configurations.containsKey(project.name)
|
||||||
|
|
||||||
val flavor = "debug"
|
val flavor = "debug"
|
||||||
|
|
||||||
fun compileSdkVersion(project: Project) = configurations[project.name!!]?.compileSdkVersion
|
fun compileSdkVersion(project: Project) = configurations[project.name]?.compileSdkVersion
|
||||||
fun buildToolsVersion(project: Project) : String {
|
fun buildToolsVersion(project: Project) : String {
|
||||||
val version = configurations[project.name!!]?.buildToolsVersion
|
val version = configurations[project.name]?.buildToolsVersion
|
||||||
if (OperatingSystem.current().isWindows()) {
|
if (OperatingSystem.current().isWindows() && version == "21.1.2")
|
||||||
if (version == "22.0.1" || version == "23.0.1") {
|
return "build-tools-$version"
|
||||||
return version
|
else
|
||||||
} else {
|
|
||||||
return "build-tools-$version"
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return version as String
|
return version as String
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun androidHome(project: Project) : String {
|
fun androidHome(project: Project) : String {
|
||||||
var result = configurations[project.name!!]?.androidHome
|
var result = configurations[project.name]?.androidHome
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
result = System.getenv("ANDROID_HOME")
|
result = System.getenv("ANDROID_HOME")
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
|
@ -128,7 +123,7 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler) :
|
||||||
private fun generateR(project: Project, generated: Path, aapt: String) {
|
private fun generateR(project: Project, generated: Path, aapt: String) {
|
||||||
val compileSdkVersion = compileSdkVersion(project)
|
val compileSdkVersion = compileSdkVersion(project)
|
||||||
val androidJar = Paths.get(androidHome(project), "platforms", "android-$compileSdkVersion", "android.jar")
|
val androidJar = Paths.get(androidHome(project), "platforms", "android-$compileSdkVersion", "android.jar")
|
||||||
val applicationId = configurations[project.name!!]?.applicationId!!
|
val applicationId = configurations[project.name]?.applicationId!!
|
||||||
val manifestDir = Paths.get(project.directory, "app", "src", "main").toString()
|
val manifestDir = Paths.get(project.directory, "app", "src", "main").toString()
|
||||||
val manifest = Paths.get(manifestDir, "AndroidManifest.xml")
|
val manifest = Paths.get(manifestDir, "AndroidManifest.xml")
|
||||||
|
|
||||||
|
@ -249,7 +244,7 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler) :
|
||||||
|
|
||||||
override fun entriesFor(project: Project?): Collection<IClasspathDependency> {
|
override fun entriesFor(project: Project?): Collection<IClasspathDependency> {
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
return classpathEntries.get(project.name!!) ?: listOf()
|
return classpathEntries.get(project.name) ?: listOf()
|
||||||
} else {
|
} else {
|
||||||
return listOf()
|
return listOf()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue