abouttreesummaryrefslogcommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorJ. Fronny2025-09-29 00:37:26 +0200
committerGitHub2025-09-29 00:37:26 +0200
commit7fdf63b930e51a06011ce911cf87a03c41b8334d (patch)
tree84993a4eb8689c285b9f308420513fcee1d12df4 /build.gradle
parent462b860e4e2930f5516b6e2ab5e203f05b98bf4d (diff)
downloadunexpected-keyboard-7fdf63b930e51a06011ce911cf87a03c41b8334d.tar.gz
unexpected-keyboard-7fdf63b930e51a06011ce911cf87a03c41b8334d.zip
Upgrade Gradle (#1097)
* Enable configuration cache and up-to-date checking
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle186
1 files changed, 0 insertions, 186 deletions
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index 444525e..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,186 +0,0 @@
-plugins {
- id 'com.android.application' version '8.6.0'
-}
-
-dependencies {
- implementation "androidx.window:window-java:1.3.0"
- implementation "androidx.core:core:1.16.0"
- testImplementation "junit:junit:4.13.2"
-}
-
-android {
- namespace 'juloo.keyboard2'
- compileSdk 35
-
- defaultConfig {
- applicationId "juloo.keyboard2"
- minSdk 21
- targetSdkVersion 35
- versionCode 50
- versionName "1.32.1"
- }
-
- sourceSets {
- main {
- manifest.srcFile 'AndroidManifest.xml'
- java.srcDirs = ['srcs/juloo.keyboard2']
- res.srcDirs = ['res', 'build/generated-resources']
- assets.srcDirs = ['assets']
- }
-
- test {
- java.srcDirs = ['test']
- }
- }
-
- signingConfigs {
- // Debug builds will always be signed. If no environment variables are set, a default
- // keystore will be initialized by the task initDebugKeystore and used. This keystore
- // can be uploaded to GitHub secrets by following instructions in CONTRIBUTING.md
- // in order to always receive correctly signed debug APKs from the CI.
- debug {
- storeFile(System.env.DEBUG_KEYSTORE ? file(System.env.DEBUG_KEYSTORE) : file("debug.keystore"))
- storePassword(System.env.DEBUG_KEYSTORE_PASSWORD ? "$System.env.DEBUG_KEYSTORE_PASSWORD" : "debug0")
- keyAlias(System.env.DEBUG_KEY_ALIAS ? "$System.env.DEBUG_KEY_ALIAS" : "debug")
- keyPassword(System.env.DEBUG_KEY_PASSWORD ? "$System.env.DEBUG_KEY_PASSWORD" : "debug0")
- }
-
- release {
- if (System.env.RELEASE_KEYSTORE) {
- storeFile file(System.env.RELEASE_KEYSTORE)
- storePassword "$System.env.RELEASE_KEYSTORE_PASSWORD"
- keyAlias "$System.env.RELEASE_KEY_ALIAS"
- keyPassword "$System.env.RELEASE_KEY_PASSWORD"
- }
- }
- }
-
- buildTypes {
- release {
- minifyEnabled true
- shrinkResources true
- debuggable false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
- resValue "string", "app_name", "@string/app_name_release"
- signingConfig signingConfigs.release
- }
-
- debug {
- minifyEnabled false
- shrinkResources false
- debuggable true
- applicationIdSuffix ".debug"
- resValue "string", "app_name", "@string/app_name_debug"
- resValue "bool", "debug_logs", "true"
- signingConfig signingConfigs.debug
- }
- }
-
- // Name outputs after the application ID.
- android.applicationVariants.all { variant ->
- variant.outputs.all {
- outputFileName = "${applicationId}.apk"
- }
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- lintOptions {
- }
-}
-
-tasks.register('buildKeyboardFont') {
- println "\nBuilding assets/special_font.ttf"
- mkdir "$buildDir"
- exec {
- workingDir "$projectDir/srcs/special_font"
- def svgFiles = workingDir.listFiles().findAll {
- it.isFile() && it.name.endsWith(".svg")
- }
- commandLine("fontforge", "-lang=ff", "-script", "build.pe", "$buildDir/special_font.ttf", *svgFiles)
- }
- copy {
- from "$buildDir/special_font.ttf"
- into "assets"
- }
-}
-
-tasks.register('genEmojis') {
- println "\nGenerating res/raw/emojis.txt"
- exec {
- workingDir = projectDir
- commandLine "python", "gen_emoji.py"
- }
-}
-
-tasks.withType(Test).configureEach {
- dependsOn 'genLayoutsList'
- dependsOn 'checkKeyboardLayouts'
- dependsOn 'compileComposeSequences'
-}
-
-tasks.register('genLayoutsList') {
- println "\nGenerating res/values/layouts.xml"
- exec {
- workingDir = projectDir
- commandLine "python", "gen_layouts.py"
- }
-}
-
-tasks.register('checkKeyboardLayouts') {
- println "\nChecking layouts"
- exec {
- workingDir = projectDir
- commandLine("python", "check_layout.py")
- }
-}
-
-tasks.register('compileComposeSequences') {
- def out = "srcs/juloo.keyboard2/ComposeKeyData.java"
- println "\nGenerating ${out}"
- exec {
- def sequences = new File(projectDir, "srcs/compose").listFiles().findAll {
- !it.name.endsWith(".py") && !it.name.endsWith(".md")
- }
- workingDir = projectDir
- commandLine("python", "srcs/compose/compile.py", *sequences)
- standardOutput = new FileOutputStream("${projectDir}/${out}")
- }
-}
-
-tasks.named("preBuild") {
- dependsOn += "initDebugKeystore"
- dependsOn += "copyRawQwertyUS"
- dependsOn += "copyLayoutDefinitions"
-}
-
-tasks.register('initDebugKeystore') {
- if (!file("debug.keystore").exists()) {
- println "Initializing default debug keystore"
- exec {
- // A shell script might be needed if this line requires input from the user
- commandLine "keytool", "-genkeypair", "-dname", "cn=d, ou=e, o=b, c=ug", "-alias", "debug", "-keypass", "debug0", "-keystore", "debug.keystore", "-keyalg", "rsa", "-storepass", "debug0", "-validity", "10000"
- }
- }
-}
-
-// latn_qwerty_us is used as a raw resource by the custom layout option.
-tasks.register('copyRawQwertyUS')
-{
- copy {
- from "srcs/layouts/latn_qwerty_us.xml"
- into "build/generated-resources/raw"
- }
-}
-
-tasks.register('copyLayoutDefinitions')
-{
- copy {
- from "srcs/layouts"
- include "*.xml"
- into "build/generated-resources/xml"
- }
-}