1
0
Fork 0

upgraded Gradle 8.0.2 -> 8.2.2

This commit is contained in:
sspanak 2024-02-10 15:59:51 +02:00 committed by Dimo Karaivanov
parent 041690f8bd
commit 140b8ced08
192 changed files with 162 additions and 187 deletions

View file

@ -48,11 +48,11 @@ Make sure you have a signing key. If you don't have one, follow the [official ma
## Adding a New Language
To support a new language one needs to:
- Find a suitable dictionary and add it to the `languages/dictionaries/` folder. Two file formats are supported, [see below](#dictionary-formats).
- Find a suitable dictionary and add it to the `app/languages/dictionaries/` folder. Two file formats are supported, [see below](#dictionary-formats).
- Do not forget to include the dictionary license (or readme) file in the `docs/` folder.
- Create a new `.yml` file in `languages/definitions/` and define the language properties.
- Create a new `.yml` file in `app/languages/definitions/` and define the language properties.
- `locale` contains the language and the country codes (e.g. "en-US", "es-AR", "it-IT"). Refer to the list of [supported locales in Java](https://www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html#util-text).
- `dictionaryFile` is the name of the dictionary in `languages/dictionaries/` folder.
- `dictionaryFile` is the name of the dictionary in `app/languages/dictionaries/` folder.
- `layout` contains the letters and punctuation marks associated with each key.
- For 0-key `[SPECIAL]`, will be fine in most languages, but you could define your own set of special characters, for example: `[@, #, $]`.
- For 1-key, you could use `[PUNCTUATION]` and have standard English/computer punctuation; or `[PUNCTUATION_FR]` that includes the French quotation marks: `«`, `»`; or `[PUNCTUATION_DE]` that includes the German quotation marks: `„`, `“`. And if the language has extra punctuation marks, like Spanish, you could complement the list like this: `[PUNCTUATION, ¡, ¿]`. Or you could define your own list, like for 0-key.

View file

@ -1,5 +1,5 @@
# Traditional T9
TT9 is an IME (Input Method Editor) for Android devices with a hardware keypad. It supports predictive text typing in [multiple languages](languages/definitions) and configurable hotkeys, bringing old school Nokia experience to modern Android devices.
TT9 is an IME (Input Method Editor) for Android devices with a hardware keypad. It supports predictive text typing in [multiple languages](app/languages/definitions) and configurable hotkeys, bringing old school Nokia experience to modern Android devices.
This is a modernized version of the [original project](https://github.com/Clam-/TraditionalT9) by Clam-.

102
app/build.gradle Normal file
View file

@ -0,0 +1,102 @@
plugins {
id 'com.android.application'
id "at.zierler.yamlvalidator" version "1.5.0"
}
apply from: 'constants.gradle'
apply from: 'dictionary-tools.gradle'
apply from: 'validate-languages.gradle'
apply from: 'version-tools.gradle'
tasks.register('validateLanguages') {
mustRunAfter(validateYaml)
inputs.dir fileTree(dir: LANGUAGES_INPUT_DIR)
outputs.file "${project.buildDir}/lang.validation.txt"
doLast {
validateLanguageFiles(DEFINITIONS_INPUT_DIR, DICTIONARIES_INPUT_DIR, outputs.files.singleFile)
}
}
tasks.register('copyLanguages', Copy) {
from LANGUAGES_INPUT_DIR
include '**/*.csv'
include '**/*.txt'
include '**/*.yml'
into LANGUAGES_OUTPUT_DIR
}
tasks.register('calculateDictionarySizes') {
inputs.dir fileTree(dir: DICTIONARIES_INPUT_DIR)
outputs.dir DICTIONARIES_OUTPUT_DIR
doLast {
getDictionarySizes(DICTIONARIES_INPUT_DIR, DICTIONARIES_OUTPUT_DIR)
}
}
clean {
delete LANGUAGES_OUTPUT_DIR
}
// using the exported Closures directly causes weird values, hence the extra wrappers here
def getVerCode = { -> return getVersionCode() }
def getVerName = { -> return getVersionName() }
def getVersionString = { flavor -> return flavor == 'debug' ? getDebugVersion() : getReleaseVersion() }
android {
namespace 'io.github.sspanak.tt9'
compileSdk 34
defaultConfig {
applicationId "io.github.sspanak.tt9"
minSdk 19
//noinspection ExpiredTargetSdkVersion
targetSdk 30
versionCode getVerCode()
versionName getVerName()
}
buildFeatures {
buildConfig true
}
buildTypes {
debug {
buildConfigField 'String', 'VERSION_FULL', "\"${getVersionString('debug')}\""
}
release {
buildConfigField 'String', 'VERSION_FULL', "\"${getVersionString('release')}\""
debuggable false
jniDebuggable false
// minifyEnabled true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.configureEach { variant ->
tasks.named("generate${variant.name.capitalize()}Assets")?.configure {
dependsOn(validateLanguages, copyLanguages, calculateDictionarySizes)
}
// generateDebugLintReportModel
["lintAnalyzeDebug", "generateDebugLintReportModel", "lintVitalAnalyzeRelease", "generateReleaseLintVitalReportModel"].each { taskName ->
tasks.named(taskName)?.configure {
dependsOn(validateLanguages, copyLanguages, calculateDictionarySizes)
}
}
}
}
dependencies {
implementation 'androidx.preference:preference:1.2.1'
}

19
app/constants.gradle Normal file
View file

@ -0,0 +1,19 @@
ext.LANGUAGES_DIR_NAME = 'languages'
ext.DEFINITIONS_DIR_NAME = 'definitions'
ext.DICTIONARIES_DIR_NAME = 'dictionaries'
ext.DICTIONARY_SIZES_DIR_NAME = 'dictionary-sizes'
def ROOT_DIR = "${project.rootDir}/app"
def ASSETS_DIR = "${ROOT_DIR}/src/main/assets"
ext.LANGUAGES_INPUT_DIR = "${ROOT_DIR}/${LANGUAGES_DIR_NAME}"
ext.DEFINITIONS_INPUT_DIR = "${LANGUAGES_INPUT_DIR}/${DEFINITIONS_DIR_NAME}"
ext.DICTIONARIES_INPUT_DIR = "${LANGUAGES_INPUT_DIR}/${DICTIONARIES_DIR_NAME}"
ext.LANGUAGES_OUTPUT_DIR = "${ASSETS_DIR}/${LANGUAGES_DIR_NAME}"
ext.DEFINITIONS_OUTPUT_DIR = "${LANGUAGES_OUTPUT_DIR}/${DEFINITIONS_DIR_NAME}"
ext.DICTIONARIES_OUTPUT_DIR = "${LANGUAGES_OUTPUT_DIR}/${DICTIONARIES_DIR_NAME}"
ext.CSV_DELIMITER = ' ' // TAB
ext.MAX_WORD_FREQUENCY = 255
ext.MAX_ERRORS = 50

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

Can't render this file because it is too large.

View file

@ -18,9 +18,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# LanguageDefinition properties must be preserved so that SnakeYAML can map them
# to the language YAMLs.
-keepclassmembers class io.github.sspanak.tt9.languages.LanguageDefinition {
public *;
}

Some files were not shown because too many files have changed in this diff Show more