diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 454955938..000000000 --- a/app/build.gradle +++ /dev/null @@ -1,97 +0,0 @@ -plugins { - id 'com.android.application' -} - -apply plugin: 'realm-android' - -android { - compileSdkVersion rootProject.ext.compileSdkVersion - defaultConfig { - applicationId "io.pslab" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 22 - versionName "2.1.0" - multiDexEnabled true - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } - - signingConfigs { - release { - if (System.getenv("KEYSTORE_FILE") != null) { - storeFile file(System.getenv('KEYSTORE_FILE')) - storePassword System.getenv("STORE_PASS") - keyAlias System.getenv("ALIAS") - keyPassword System.getenv("KEY_PASS") - } - } - } - - buildTypes { - debug { - versionNameSuffix "Version: " - resValue "string", "version", "${versionNameSuffix}${defaultConfig.versionName}" - } - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - resValue "string", "version", "${defaultConfig.versionName}" - signingConfigs.release - } - } - lintOptions { - abortOnError false - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - - // Android stock libraries - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.3.0' - implementation 'com.google.android.material:material:1.9.0' - implementation 'androidx.preference:preference:1.2.0' - implementation 'androidx.browser:browser:1.5.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - - // Custom tools libraries - implementation "com.github.PhilJay:MPAndroidChart:$rootProject.mpAndroidChartVersion" - implementation "com.github.bmelnychuk:atv:$rootProject.atvVersion" - implementation "de.hdodenhof:circleimageview:$rootProject.circleImageViewVersion" - implementation "com.github.devlight.navigationtabstrip:navigationtabstrip:$rootProject.navTabStripVersion" - implementation "com.afollestad.material-dialogs:core:$rootProject.materialDialogsVersion" - implementation "com.github.medyo:android-about-page:$rootProject.androidAboutPageVersion" - implementation "com.github.tiagohm.MarkdownView:library:$rootProject.markDownViewVersion" - implementation "com.github.mirrajabi:search-dialog:$rootProject.searchDialogVersion" - implementation "com.sdsmdg.harjot:croller:$rootProject.crollerVersion" - implementation "com.github.BeppiMenozzi:Knob:$rootProject.knobLibraryVersion" - implementation "com.github.warkiz.widget:indicatorseekbar:$rootProject.seekBarLibraryVersion" - implementation "com.github.Vatican-Cameos:CarouselPicker:$rootProject.carouselPickerVersion" - implementation "com.github.anastr:speedviewlib:$rootProject.speedView" - - implementation "org.apache.commons:commons-math3:$rootProject.commonMathVersion" - implementation "org.apache.commons:commons-lang3:$rootProject.commonLangVersion" - implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion" - - implementation 'com.github.GoodieBag:ProtractorView:v1.2' - implementation 'com.github.Triggertrap:SeekArc:v1.1' - - implementation "com.squareup.okhttp3:okhttp:$rootProject.okHttpVersion" - - implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion" - annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion" - - // Map libraries - implementation "org.osmdroid:osmdroid-android:$rootProject.osmVersion" - implementation "org.osmdroid:osmdroid-mapsforge:$rootProject.mapsforgeVersion" - implementation "org.osmdroid:osmdroid-geopackage:$rootProject.geoPackageVersion" - - implementation 'androidx.multidex:multidex:2.0.1' - implementation "io.realm:android-adapters:$rootProject.realmAdapter" -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 000000000..0ae0981e5 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,107 @@ +plugins { + id("com.android.application") +} + +apply(plugin = "realm-android") + +val keystoreExists = System.getenv("KEYSTORE_FILE") != null + +android { + namespace = "io.pslab" + compileSdk = 33 + + defaultConfig { + applicationId = "io.pslab" + minSdk = 21 + targetSdk = 31 + versionCode = 22 + versionName = "2.1.0" + } + + signingConfigs { + if (keystoreExists) { + register("release") { + storeFile = file(System.getenv("KEYSTORE_FILE")) + storePassword = System.getenv("STORE_PASS") + keyAlias = System.getenv("ALIAS") + keyPassword = System.getenv("KEY_PASS") + } + } + } + + buildTypes { + debug { + versionNameSuffix = "Version: " + resValue("string", "version", "${versionNameSuffix}${defaultConfig.versionName}") + } + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android.txt"), + "proguard-rules.pro" + ) + resValue("string", "version", "${defaultConfig.versionName}") + signingConfig = if (keystoreExists) signingConfigs.getByName("release") else null + } + } + lint { + abortOnError = false + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} + +dependencies { + + // Android stock libraries + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("androidx.cardview:cardview:1.0.0") + implementation("androidx.recyclerview:recyclerview:1.3.0") + implementation("com.google.android.material:material:1.9.0") + implementation("androidx.preference:preference:1.2.0") + implementation("androidx.browser:browser:1.5.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.4") + + // Custom tools libraries + implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") + implementation("com.github.bmelnychuk:atv:1.2.9") + implementation("de.hdodenhof:circleimageview:3.1.0") + implementation("com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4") + implementation("com.afollestad.material-dialogs:core:0.9.6.0") + implementation("com.github.medyo:android-about-page:1.3.1") + implementation("com.github.tiagohm.MarkdownView:library:0.19.0") + implementation("com.github.mirrajabi:search-dialog:1.2.4") + implementation("com.sdsmdg.harjot:croller:1.0.7") + implementation("com.github.BeppiMenozzi:Knob:1.9.0") + implementation("com.github.warkiz.widget:indicatorseekbar:2.1.2") + implementation("com.github.Vatican-Cameos:CarouselPicker:1.2") + implementation("com.github.anastr:speedviewlib:1.6.0") + implementation("com.github.GoodieBag:ProtractorView:v1.2") + implementation("com.github.Triggertrap:SeekArc:v1.1") + + // Apache commons + implementation("org.apache.commons:commons-math3:3.6.1") + implementation("org.apache.commons:commons-lang3:3.12.0") + + // Picasso + implementation("com.squareup.picasso:picasso:2.71828") + + // OKHTTP + implementation("com.squareup.okhttp3:okhttp:4.9.3") + + // ButterKnife + val butterKnifeVersion = "10.2.3" + annotationProcessor("com.jakewharton:butterknife-compiler:$butterKnifeVersion") + implementation("com.jakewharton:butterknife:$butterKnifeVersion") + + // Map libraries + val osmDroidVersion = "6.1.11" + implementation("org.osmdroid:osmdroid-android:$osmDroidVersion") + implementation("org.osmdroid:osmdroid-mapsforge:$osmDroidVersion") + implementation("org.osmdroid:osmdroid-geopackage:$osmDroidVersion") + + // Realm + implementation("io.realm:android-adapters:4.0.0") +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 3e6d93f41..5bb1f14fc 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in /home/viveksb007/Android/Sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# directive in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6780c0a90..518fa7245 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> @@ -130,4 +129,4 @@ - \ No newline at end of file + diff --git a/build.gradle b/build.gradle deleted file mode 100644 index fae796aff..000000000 --- a/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath "io.realm:realm-gradle-plugin:10.11.0" - } -} - -plugins { - id 'com.android.application' version '7.4.2' apply false -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -// Define versions in a single place -ext { - // Sdk and tools - minSdkVersion = 23 - targetSdkVersion = 31 - compileSdkVersion = 33 - - // App dependencies - androidAboutPageVersion = '1.3.1' - atvVersion = '1.2.9' - butterKnifeVersion = '10.2.3' - carouselPickerVersion = '1.2' - circleImageViewVersion = '3.1.0' - commonLangVersion = '3.12.0' - commonMathVersion = '3.6.1' - constraintLayoutVersion = '2.0.4' - crollerVersion = '1.0.7' - knobLibraryVersion = '1.9.0' - markDownViewVersion = '0.19.0' - materialDialogsVersion = '0.9.6.0' - mpAndroidChartVersion = 'v3.1.0' - navTabStripVersion = '1.0.4' - okHttpVersion = '4.9.3' - picassoVersion = '2.71828' - realmAdapter = '4.0.0' - searchDialogVersion = '1.2.4' - seekBarLibraryVersion = '2.1.2' - speedView = '1.6.0' - supportLibraryVersion = '28.0.0' - - // Map related versions - osmVersion = '6.1.11' - mapsforgeVersion = '6.1.11' - geoPackageVersion = '6.1.11' - googleMapsVersion = '18.0.2' - - // MultiDex - multiDexVersion = '1.0.3' - - // Test dependencies - testRunnerRulesVersion = '1.0.2' - junitVersion = '4.13.2' - espressoVersion = '3.0.2' - mockitoVersion = '2.8.9' -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..9bb9b7d24 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,13 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("io.realm:realm-gradle-plugin:10.11.0") + } +} + +plugins { + id("com.android.application") version "7.4.2" apply false +} diff --git a/settings.gradle b/settings.gradle.kts similarity index 73% rename from settings.gradle rename to settings.gradle.kts index 13ff88f06..675d94659 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -10,9 +10,9 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - maven { url "https://jitpack.io" } - maven { url "https://plugins.gradle.org/m2/" } + maven("https://jitpack.io") + maven("https://plugins.gradle.org/m2/") } } rootProject.name = "PSLab" -include ':app' +include(":app")