You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
6.0 KiB
Groovy
177 lines
6.0 KiB
Groovy
buildscript {
|
|
ext.kotlin_version = "1.9.22"
|
|
ext.compose_version = "1.5.10"
|
|
ext.accompanist_version = "0.34.0"
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven {
|
|
url = uri("https://plugins.gradle.org/m2/")
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:8.5.1'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
classpath("com.ncorti.ktfmt.gradle:plugin:0.17.0")
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
flatDir {
|
|
dirs 'libs'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
|
|
apply plugin: 'com.ncorti.ktfmt.gradle'
|
|
|
|
android {
|
|
ndkVersion "23.1.7779620"
|
|
compileSdkVersion 34
|
|
defaultConfig {
|
|
minSdkVersion 26
|
|
targetSdkVersion 34
|
|
versionCode 241
|
|
versionName "1.75.3-tafec2d41b-gffbc556cde8"
|
|
|
|
// This setting, which defaults to 'true', will cause Tailscale to fall
|
|
// back to the Google DNS servers if it cannot determine what the
|
|
// operating system's DNS configuration is.
|
|
//
|
|
// Set it to false either here or in your local.properties file to
|
|
// disable this behaviour.
|
|
buildConfigField "boolean", "USE_GOOGLE_DNS_FALLBACK", getLocalProperty("tailscale.useGoogleDnsFallback", "true")
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
buildFeatures {
|
|
buildConfig true
|
|
compose true
|
|
}
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = "$compose_version"
|
|
}
|
|
flavorDimensions "version"
|
|
namespace 'com.tailscale.ipn'
|
|
|
|
buildTypes {
|
|
applicationTest {
|
|
initWith debug
|
|
manifestPlaceholders.leanbackRequired = false
|
|
buildConfigField "String", "GITHUB_USERNAME", "\"" + getLocalProperty("githubUsername", "")+"\""
|
|
buildConfigField "String", "GITHUB_PASSWORD", "\"" + getLocalProperty("githubPassword", "")+"\""
|
|
buildConfigField "String", "GITHUB_2FA_SECRET", "\"" + getLocalProperty("github2FASecret", "")+"\""
|
|
}
|
|
debug {
|
|
manifestPlaceholders.leanbackRequired = false
|
|
}
|
|
release {
|
|
manifestPlaceholders.leanbackRequired = false
|
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true
|
|
|
|
proguardFiles getDefaultProguardFile(
|
|
'proguard-android-optimize.txt'),
|
|
'proguard-rules.pro'
|
|
}
|
|
release_tv {
|
|
initWith release
|
|
manifestPlaceholders.leanbackRequired = true
|
|
}
|
|
}
|
|
|
|
testBuildType "applicationTest"
|
|
}
|
|
|
|
dependencies {
|
|
// Android dependencies.
|
|
implementation "androidx.core:core:1.13.1"
|
|
implementation 'androidx.core:core-ktx:1.13.1'
|
|
implementation "androidx.browser:browser:1.8.0"
|
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
implementation "androidx.work:work-runtime:2.9.0"
|
|
|
|
// Kotlin dependencies.
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
|
|
implementation 'junit:junit:4.13.2'
|
|
runtimeOnly "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
|
|
|
// Compose dependencies.
|
|
def composeBom = platform('androidx.compose:compose-bom:2024.06.00')
|
|
implementation composeBom
|
|
implementation 'androidx.compose.material3:material3:1.2.1'
|
|
implementation 'androidx.compose.material:material-icons-core:1.6.8'
|
|
implementation "androidx.compose.ui:ui:1.6.8"
|
|
implementation "androidx.compose.ui:ui-tooling:1.6.8"
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3'
|
|
implementation 'androidx.activity:activity-compose:1.9.0'
|
|
implementation "com.google.accompanist:accompanist-permissions:$accompanist_version"
|
|
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
|
|
implementation "androidx.core:core-splashscreen:1.1.0-rc01"
|
|
|
|
// Navigation dependencies.
|
|
def nav_version = "2.7.7"
|
|
implementation "androidx.navigation:navigation-compose:$nav_version"
|
|
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
|
|
|
|
// Supporting libraries.
|
|
implementation("io.coil-kt:coil-compose:2.6.0")
|
|
implementation("com.google.zxing:core:3.5.1")
|
|
implementation("com.patrykandpatrick.vico:compose:1.15.0")
|
|
implementation("com.patrykandpatrick.vico:compose-m3:1.15.0")
|
|
|
|
// Tailscale dependencies.
|
|
implementation ':libtailscale@aar'
|
|
|
|
// Integration Tests
|
|
androidTestImplementation composeBom
|
|
androidTestImplementation 'androidx.test:runner:1.6.1'
|
|
androidTestImplementation 'androidx.test.ext:junit-ktx:1.2.1'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
implementation 'androidx.test.uiautomator:uiautomator:2.3.0'
|
|
|
|
|
|
// Authentication only for tests
|
|
androidTestImplementation 'dev.turingcomplete:kotlin-onetimepassword:2.4.0'
|
|
androidTestImplementation 'commons-codec:commons-codec:1.16.1'
|
|
|
|
// Unit Tests
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
}
|
|
|
|
def getLocalProperty(key, defaultValue) {
|
|
try {
|
|
Properties properties = new Properties()
|
|
properties.load(project.file('local.properties').newDataInputStream())
|
|
return properties.getProperty(key) ?: defaultValue
|
|
} catch(Throwable ignored) {
|
|
return defaultValue
|
|
}
|
|
}
|