This repository has been archived on 2026-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
DashboardClient/app_dashboard/build.gradle
2025-09-12 14:23:33 +08:00

116 lines
3.7 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

plugins {
id 'com.android.application'
}
apply from: '../common.gradle'
android {
namespace 'cn.ykbox.dashboard'
compileSdk 35
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "cn.ykbox.dashboard"
minSdk 21
targetSdk 35
versionCode gitVersionCode()
versionName gitVersionTag()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
signingConfig signingConfigs.release
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
// sign the application
signingConfigs {
release {
storeFile file('..\\sinclass.jks')
storePassword '=efX!O4i'
keyAlias 'ScreenClient'
keyPassword '=efX!O4i'
v1SigningEnabled true
v2SigningEnabled true
}
}
android.applicationVariants.all { variant ->
def docDir = rootProject.getRootDir().getAbsolutePath() + "/../apk/dashboard"
def releaseDir = rootProject.getRootDir().getAbsolutePath() + "/../apk/dashboard"
if (versionName.contains("beta"))
releaseDir += "/beta"
variant.outputs.all {
// 常规版本不加后缀
outputFileName = "dashboard_${defaultConfig.versionName}.apk"
}
// assemble 结束后将apk复制到指定目录
variant.assembleProvider.get().doLast {
variant.outputs.all {
if (variant.buildType.name == 'release') {
copy {
from "${project.getProjectDir().path}/build/outputs/apk/${variant.buildType.name}/${outputFileName}"
into releaseDir
}
def downloadUrl = "http://thinkdisk.thinkbo.cn/src/web/dashboard/${outputFileName}"
genUpdateJson(downloadUrl, releaseDir, outputFileName, 'changelog.md', defaultConfig, variant)
File file = new File("${project.getProjectDir().path}/changelog.md")
replaceText(file, 'VERSION_CODE', "${defaultConfig.versionCode}")
// 用 pandoc 将 changelog.md 导出为 html 格式
exec {
workingDir project.getProjectDir().getAbsolutePath()
commandLine 'pandoc', '--standalone', '--embed-resources',
'--css', rootProject.getRootDir().getAbsolutePath() + '/doc/themes/blue/blue.css',
'changelog.md', '-f',
'markdown', '-t', 'html', '-s',
'-o', "${docDir}/changelog.html"
}
}
}
}
}
}
repositories {
maven { url "https://s01.oss.sonatype.org/content/groups/public" }
}
dependencies {
implementation libs.appcompat
implementation libs.material
implementation libs.activity
implementation libs.constraintlayout
implementation libs.preference
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core
implementation libs.utilcodex
implementation libs.okhttp
implementation libs.banner
implementation libs.glide
annotationProcessor libs.glidecompiler
implementation 'io.github.xmaihh:serialport:2.1.1'
}