init projects
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package ru.shadowsparky
|
||||
|
||||
import com.android.build.api.dsl.ApplicationExtension
|
||||
import com.android.build.api.dsl.LibraryExtension
|
||||
import org.gradle.api.JavaVersion
|
||||
import org.gradle.api.Project
|
||||
|
||||
fun LibraryExtension.setupAndroid(project: Project) {
|
||||
val libs = project.findLibs()
|
||||
compileSdk {
|
||||
version = release(libs.findVersion("proj.compile").get().toString().toInt())
|
||||
}
|
||||
defaultConfig {
|
||||
minSdk = libs.findVersion("proj.min").get().toString().toInt()
|
||||
}
|
||||
compileOptions {
|
||||
val javaVersion = JavaVersion.toVersion(libs.findVersion("proj.java").get())
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
}
|
||||
}
|
||||
|
||||
fun ApplicationExtension.setupAndroid(project: Project) {
|
||||
val libs = project.findLibs()
|
||||
compileSdk {
|
||||
version = release(libs.findVersion("proj.compile").get().toString().toInt())
|
||||
}
|
||||
defaultConfig {
|
||||
minSdk = libs.findVersion("proj.min").get().toString().toInt()
|
||||
targetSdk {
|
||||
version = release(libs.findVersion("proj.target").get().toString().toInt())
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
val javaVersion = JavaVersion.toVersion(libs.findVersion("proj.java").get())
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user