Skip to content

Commit

Permalink
(Android) Upgraded build tools and libraries to their latest versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adil Hussain committed Jul 14, 2023
1 parent c9615ee commit 1c19d12
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 77 deletions.
2 changes: 1 addition & 1 deletion Android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
mavenCentral()
}
dependencies {
implementation 'com.tazkiyatech:quran-sdk:1.2.0'
implementation 'com.tazkiyatech:quran-sdk:1.3.0'
}
```

Expand Down
61 changes: 18 additions & 43 deletions Android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'signing'

group = getProperty('projectGroupName')
version = getProperty('projectVersionName')

File[] proGuardFileCollection = file('./proguard').listFiles()
File[] proGuardDebugFileCollection = file('./proguard-debug').listFiles()

android {
compileSdkVersion 31
compileSdkVersion 33
namespace 'com.tazkiyatech.quran.sdk'

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments clearPackageData: 'true'
}
Expand All @@ -25,28 +18,34 @@ android {
debug {
minifyEnabled false
shrinkResources false
proguardFile(getDefaultProguardFile('proguard-android.txt'))
proguardFiles(proGuardFileCollection)
proguardFiles(proGuardDebugFileCollection)
}

release {
minifyEnabled false
shrinkResources false
proguardFile(getDefaultProguardFile('proguard-android.txt'))
proguardFiles(proGuardFileCollection)
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}

lintOptions {
abortOnError true
}

publishing {
singleVariant('release') {
withJavadocJar()
withSourcesJar()
}
}

testOptions {
animationsDisabled true
execution 'ANDROIDX_TEST_ORCHESTRATOR'
Expand All @@ -57,37 +56,22 @@ android {
}

dependencies {
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'androidx.annotation:annotation:1.6.0'

testImplementation "org.hamcrest:hamcrest-library:$hamcrest_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit5_version"

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'com.tazkiyatech:android-test-utils:1.8.0'
androidTestImplementation 'com.tazkiyatech:android-test-utils:1.9.0'
androidTestImplementation "org.hamcrest:hamcrest-library:$hamcrest_version"
}

task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
group = 'build'
}

task generateJavadocJar(type: Jar) {
from dokkaJavadoc
classifier 'javadoc'
description = "Builds up a jar of this module's Javadoc."
group = 'build'
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
artifact generateJavadocJar
artifact generateSourcesJar

groupId getProperty('projectGroupName')
artifactId getProperty('projectArtifactName')
Expand Down Expand Up @@ -121,15 +105,6 @@ afterEvaluate {
}
}
}
debug(MavenPublication) {
from components.debug
artifact generateJavadocJar
artifact generateSourcesJar

groupId getProperty('projectGroupName')
artifactId getProperty('projectArtifactName')
version getProperty('projectVersionName')
}
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getSurahNames() {
// Given.
val expected = listOf(
QueryPlanRow("SCAN TABLE sura_names USING INDEX index_sura_number_on_table_sura_names")
QueryPlanRow("SCAN sura_names USING INDEX index_sura_number_on_table_sura_names")
)

// When.
Expand All @@ -46,7 +46,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getSurahName() {
// Given.
val expected = listOf(
QueryPlanRow("SEARCH TABLE sura_names USING INDEX index_sura_number_on_table_sura_names (sura=?)")
QueryPlanRow("SEARCH sura_names USING INDEX index_sura_number_on_table_sura_names (sura=?)")
)

// When.
Expand All @@ -66,7 +66,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getAyahsInSurah() {
// Given.
val expected = listOf(
QueryPlanRow("SEARCH TABLE quran_text USING INDEX index_sura_number_aya_number_on_table_quran_text (sura=?)")
QueryPlanRow("SEARCH quran_text USING INDEX index_sura_number_aya_number_on_table_quran_text (sura=?)")
)

// When.
Expand All @@ -85,7 +85,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getAyah() {
// Given.
val expected = listOf(
QueryPlanRow("SEARCH TABLE quran_text USING INDEX index_sura_number_aya_number_on_table_quran_text (sura=? AND aya=?)")
QueryPlanRow("SEARCH quran_text USING INDEX index_sura_number_aya_number_on_table_quran_text (sura=? AND aya=?)")
)

// When.
Expand All @@ -104,7 +104,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getMetadataForSectionType() {
// Given.
val expected = listOf(
QueryPlanRow("SEARCH TABLE quran_metadata USING INDEX index_section_type_section_number_on_table_quran_metadata (section_type=?)")
QueryPlanRow("SEARCH quran_metadata USING INDEX index_section_type_section_number_on_table_quran_metadata (section_type=?)")
)

// When.
Expand All @@ -123,7 +123,7 @@ class QuranDatabaseQueryPlanTests {
fun test_explainQueryPlan_for_getMetadataForSection() {
// Given.
val expected = listOf(
QueryPlanRow("SEARCH TABLE quran_metadata USING INDEX index_section_type_section_number_on_table_quran_metadata (section_type=? AND section_number=?)")
QueryPlanRow("SEARCH quran_metadata USING INDEX index_section_type_section_number_on_table_quran_metadata (section_type=? AND section_number=?)")
)

// When.
Expand Down
3 changes: 3 additions & 0 deletions Android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
</manifest>
25 changes: 4 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
buildscript {
ext.hamcrest_version = '2.2'
ext.junit5_version = '5.9.1'
ext.kotlin_version = '1.7.20'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
ext.junit5_version = '5.9.3'
}

plugins {
id("org.jetbrains.dokka") version "$kotlin_version"
}

allprojects {
repositories {
google()
mavenCentral()
}
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
}

wrapper {
gradleVersion = '7.6'
gradleVersion = '8.2.1'
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Project-wide Gradle settings.
# Project-wide Gradle properties

android.useAndroidX=true

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
17 changes: 17 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

rootProject.name = 'quran-sdk'
include ':Android'

0 comments on commit 1c19d12

Please sign in to comment.