From ed44af3ddb4f0a00a2cc48b420b29ea48243824d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Mi=C5=9B?= Date: Tue, 7 Jun 2022 13:14:18 +0200 Subject: [PATCH] Build changes (#303) * Bump TouchImageView to 3.2.0 * Update targetSdk, define buildToolsVersion * Set jvmTarget to 11 * Add verification of the downloaded Gradle distribution via SHA-256 hash sum comparison * Migrate build system to Kotlin DSL * Bump Matomo SDK --- app/build.gradle | 70 ------------------------ app/build.gradle.kts | 70 ++++++++++++++++++++++++ build.gradle | 32 ----------- build.gradle.kts | 22 ++++++++ gradle/wrapper/gradle-wrapper.properties | 4 +- settings.gradle | 1 - settings.gradle.kts | 11 ++++ 7 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 79613617..00000000 --- a/app/build.gradle +++ /dev/null @@ -1,70 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' - -android { - compileSdk 31 - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = '1.8' - } - defaultConfig { - applicationId "com.todobom.opennotescanner" - minSdkVersion 21 - targetSdk 31 - versionCode 36 - versionName '1.0.36' - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - flavorDimensions "version" - productFlavors { - fdroid { - dimension "version" - applicationIdSuffix "" - versionNameSuffix "-fdroid" - } - gplay { - dimension "version" - applicationIdSuffix "" - versionNameSuffix "-gplay" - } - } - lintOptions { - abortOnError false - } -} - -repositories { - mavenCentral() -} - -def itextpdf_version = '7.2.2' -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - implementation "androidx.core:core-ktx:1.8.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - - implementation 'androidx.exifinterface:exifinterface:1.3.3' - testImplementation 'junit:junit:4.13.2' - implementation 'androidx.appcompat:appcompat:1.4.2' - implementation 'com.google.android.material:material:1.6.1' - implementation 'com.google.zxing:core:3.5.0' - implementation 'com.github.ctodobom:OpenCV-3.1.0-Android:9e00ee4218ca0c9e60a905c9f09bf499f9dc5115' - implementation 'us.feras.mdv:markdownview:1.1.0' - implementation 'com.github.ctodobom:drag-select-recyclerview:0.3.4.ctodobom.sections' - implementation 'com.github.nostra13:Android-Universal-Image-Loader:v1.9.5' - implementation 'com.github.ctodobom:FabToolbar:3c5f0e0ff1b6d5089e20b7da7157a604075ae943' - implementation 'org.matomo.sdk:tracker:4.1.2' - implementation 'com.github.MikeOrtiz:TouchImageView:3.1.1' - implementation "com.itextpdf:kernel:$itextpdf_version" - implementation "com.itextpdf:layout:$itextpdf_version" - implementation "com.itextpdf:io:$itextpdf_version" -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 00000000..0e57ce7e --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,70 @@ +plugins { + id("com.android.application") + kotlin("android") +} + +android { + compileSdk = 32 + buildToolsVersion = "32.0.0" + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + defaultConfig { + applicationId = "com.todobom.opennotescanner" + minSdk = 21 + targetSdk = 31 + versionCode = 36 + versionName = "1.0.36" + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + flavorDimensions += "version" + productFlavors { + create("fdroid") { + dimension = "version" + applicationIdSuffix = "" + versionNameSuffix = "-fdroid" + } + create("gplay") { + dimension = "version" + applicationIdSuffix = "" + versionNameSuffix = "-gplay" + } + } + lint { + abortOnError = false + } +} + +dependencies { + implementation(fileTree(mapOf("include" to listOf("*.jar"), "dir" to "libs"))) + + implementation("androidx.core:core-ktx:1.8.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21") + + implementation("androidx.exifinterface:exifinterface:1.3.3") + testImplementation("junit:junit:4.13.2") + implementation("androidx.appcompat:appcompat:1.4.2") + implementation("com.google.android.material:material:1.6.1") + implementation("com.google.zxing:core:3.5.0") + implementation("com.github.ctodobom:OpenCV-3.1.0-Android:9e00ee4218ca0c9e60a905c9f09bf499f9dc5115") + implementation("us.feras.mdv:markdownview:1.1.0") + implementation("com.github.ctodobom:drag-select-recyclerview:0.3.4.ctodobom.sections") + implementation("com.github.nostra13:Android-Universal-Image-Loader:v1.9.5") + implementation("com.github.ctodobom:FabToolbar:3c5f0e0ff1b6d5089e20b7da7157a604075ae943") + implementation("com.github.matomo-org:matomo-sdk-android:4.1.4") + implementation("com.github.MikeOrtiz:TouchImageView:3.2.0") + + val itextpdf_version = "7.2.2" + implementation("com.itextpdf:kernel:$itextpdf_version") + implementation("com.itextpdf:layout:$itextpdf_version") + implementation("com.itextpdf:io:$itextpdf_version") +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 9315b419..00000000 --- a/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '1.6.21' - repositories { - mavenCentral() - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - jcenter() - google() - maven { - url 'https://jitpack.io' - } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..ebeeee5b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,22 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + jcenter() + google() + maven(url = "https://jitpack.io") + } + + dependencies { + classpath("com.android.tools.build:gradle:7.2.1") + classpath(kotlin("gradle-plugin", version = "1.6.21")) + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +tasks.register("clean", Delete::class) { + delete(rootProject.buildDir) +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f3ac86cc..e1e0c8dc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Jun 04 09:50:44 BRT 2022 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionSha256Sum=e6d864e3b5bc05cc62041842b306383fc1fefcec359e70cebb1d470a6094ca82 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e7b4def4..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..15a0f929 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,11 @@ +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + jcenter() + google() + maven(url = "https://jitpack.io") + } +} +rootProject.name = "Open Note Scanner" +include(":app")