From 3d0e87cdfe45b1ad8db746f86d8a87da177552ea Mon Sep 17 00:00:00 2001 From: amirisback Date: Mon, 18 Nov 2024 08:13:24 +0700 Subject: [PATCH 1/4] update: build.gradle --- app/build.gradle | 22 ++++++++++++----- build.gradle | 26 +++----------------- gradle/libs.versions.toml | 22 +++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 6 ++--- settings.gradle | 30 ++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 32 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/app/build.gradle b/app/build.gradle index 02bb721..d41db58 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,10 +14,11 @@ * limitations under the License. */ -apply plugin: 'com.android.application' +plugins { + alias(libs.plugins.android.application) +} android { - /** * Advanced Configuration */ @@ -27,7 +28,10 @@ android { def FORCE_NO_AUDIO = false // Disables WebAudio // Android 9+ "Q" API 29 - def ANDROID_SDK_TARGET = 29 + def ANDROID_SDK_TARGET = 34 + + namespace 'systems.altimit.rpgmakermv' + compileSdk ANDROID_SDK_TARGET defaultConfig { @@ -56,7 +60,7 @@ android { productFlavors { webview { dimension "mv_android_client" - minSdkVersion 14 + minSdk 14 buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true" } @@ -64,16 +68,22 @@ android { // WARNING: As of February 2017 Crosswalk is no longer maintained https://crosswalk-project.org/blog/crosswalk-final-release.html zz_crosswalk { dimension "mv_android_client" - minSdkVersion 16 + minSdk 16 buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true" } } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation libs.appcompat zz_crosswalkImplementation 'org.xwalk:xwalk_core_library:23.53.589.4' } \ No newline at end of file diff --git a/build.gradle b/build.gradle index a39985f..c59a908 100644 --- a/build.gradle +++ b/build.gradle @@ -14,27 +14,7 @@ * limitations under the License. */ -buildscript { - repositories { - google() - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} - -allprojects { - repositories { - google() - jcenter() - - maven { - url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' - } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..26dda66 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +agp = "8.7.2" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +appcompat = "1.7.0" +material = "1.12.0" +activity = "1.9.3" +constraintlayout = "2.2.0" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } +ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 39d31d4..fa84388 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jul 09 12:09:06 BST 2019 +#Mon Nov 18 08:07:47 WIB 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 9d495b3..6897cba 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,31 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + jcenter() + maven { + url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' + } + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + jcenter() + + maven { + url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' + } + } +} + include ':app' \ No newline at end of file From 6b3a7704fb229a8c60292bfd843888cbb2bf59ed Mon Sep 17 00:00:00 2001 From: amirisback Date: Mon, 18 Nov 2024 08:14:55 +0700 Subject: [PATCH 2/4] update: manifest --- app/src/main/AndroidManifest.xml | 35 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 36fcf66..e850c7f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - - - + + android:theme="@style/AppTheme"> + android:exported="true" + android:launchMode="singleTask" + android:screenOrientation="sensorLandscape"> - - + + - - - + + + + + + android:host="@string/app_host" + android:scheme="@string/app_scheme" /> From 4eabcb210b668e150db74d7858e8587d4f7128d4 Mon Sep 17 00:00:00 2001 From: amirisback Date: Mon, 18 Nov 2024 08:23:30 +0700 Subject: [PATCH 3/4] update: build.gradle --- app/build.gradle | 9 ++++++-- .../altimit/rpgmakermv/WebPlayerView.java | 2 +- gradle.properties | 23 +++++++++++++++++-- gradle/libs.versions.toml | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d41db58..fb65449 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,7 +60,7 @@ android { productFlavors { webview { dimension "mv_android_client" - minSdk 14 + minSdk 21 buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true" } @@ -68,7 +68,7 @@ android { // WARNING: As of February 2017 Crosswalk is no longer maintained https://crosswalk-project.org/blog/crosswalk-final-release.html zz_crosswalk { dimension "mv_android_client" - minSdk 16 + minSdk 21 buildConfigField "boolean", "BOOTSTRAP_INTERFACE", "true" } @@ -79,6 +79,11 @@ android { targetCompatibility JavaVersion.VERSION_11 } + buildFeatures { + buildConfig true + viewBinding true + } + } dependencies { diff --git a/app/src/webview/java/systems/altimit/rpgmakermv/WebPlayerView.java b/app/src/webview/java/systems/altimit/rpgmakermv/WebPlayerView.java index eb97eae..36ff919 100644 --- a/app/src/webview/java/systems/altimit/rpgmakermv/WebPlayerView.java +++ b/app/src/webview/java/systems/altimit/rpgmakermv/WebPlayerView.java @@ -73,7 +73,7 @@ private void init(Context context) { WebSettings webSettings = getSettings(); webSettings.setAllowContentAccess(true); webSettings.setAllowFileAccess(true); - webSettings.setAppCacheEnabled(true); +// webSettings.setAppCacheEnabled(true); webSettings.setDatabaseEnabled(true); webSettings.setDatabasePath(context.getDir("database", Context.MODE_PRIVATE).getPath()); webSettings.setDomStorageEnabled(true); diff --git a/gradle.properties b/gradle.properties index f32badb..4b29016 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,22 @@ -android.enableJetifier=true +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -org.gradle.jvmargs=-Xmx1536m \ No newline at end of file +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true +android.enableJetifier=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 26dda66..dc1552c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ agp = "8.7.2" junit = "4.13.2" junitVersion = "1.2.1" espressoCore = "3.6.1" -appcompat = "1.7.0" +appcompat = "1.0.2" material = "1.12.0" activity = "1.9.3" constraintlayout = "2.2.0" From e8f845fd8c0010aaad23f8c7e3eb30cd833f1574 Mon Sep 17 00:00:00 2001 From: amirisback Date: Mon, 18 Nov 2024 08:30:43 +0700 Subject: [PATCH 4/4] add: android-ci.yml --- .github/workflows/android-ci.yml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/android-ci.yml diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml new file mode 100644 index 0000000..a295417 --- /dev/null +++ b/.github/workflows/android-ci.yml @@ -0,0 +1,48 @@ +name: Android CI + +env: + # The name of the main module repository + main_project_module: app + + # The name of the Play Store + playstore_name: Altimit + +on: + # Triggers the workflow on push or pull request events but only for default and protected branches + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + # The workflow will be dispatched to the default queue + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Set Current Date As Env Variable + - name: Set current date as env variable + run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + # Set Repository Name As Env Variable + - name: Set repository name as env variable + run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV + + - name: Set Up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '17' + cache: 'gradle' + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + # Run Build Project + - name: Build gradle project + run: ./gradlew build \ No newline at end of file