diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db96aa3d80..3bd18f88b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,8 @@ name: generate-builds on: - push: - pull_request: + # push: + # pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -380,3 +381,29 @@ jobs: with: name: 2ship-windows path: 2ship-windows + + build-android: + needs: generate-2ship-otr + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install dependencies + run: sudo apt-get install -y ninja-build + - name: Download 2ship.o2r + uses: actions/download-artifact@v4 + with: + name: 2ship.o2r + path: Android/app/src/main/assets + - name: Build 2Ship + run: | + cd Android/ + ./gradlew assembleDebug -P elfBuildType=RelWithDebInfo + mv app/build/outputs/apk/debug/app-debug.apk ../2ship.apk + - name: Create release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} + file: 2ship.apk diff --git a/.gitignore b/.gitignore index 176b4bb21b..9dde8295ea 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ _packages/ /mm/src/boot/build.c /mm/windows/properties.h /clang-format.exe + +# IntelliJ / Android Studio +.idea diff --git a/.gitmodules b/.gitmodules index 10a75a9428..f6a6cff7a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "libultraship"] path = libultraship - url = https://github.com/Waterdish/libultraship.git + url = https://github.com/robertkirkman/libultraship.git [submodule "OTRExporter"] path = OTRExporter url = https://github.com/Waterdish/OTRExporter.git diff --git a/Android/app/build.gradle b/Android/app/build.gradle index 12d75aaa85..1cf99a3506 100644 --- a/Android/app/build.gradle +++ b/Android/app/build.gradle @@ -1,4 +1,4 @@ -def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY'); +def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY') def buildAsApplication = !buildAsLibrary if (buildAsApplication) { apply plugin: 'com.android.application' @@ -8,25 +8,21 @@ else { } android { - ndkPath "/home/waterdish/Android/Sdk/ndk/26.0.10792818" // Point to your own NDK - compileSdkVersion 31 + ndkVersion '27.2.12479018' + compileSdkVersion 34 defaultConfig { if (buildAsApplication) { applicationId "com.dishii.mm" } - minSdkVersion 24 - targetSdkVersion 31 + minSdkVersion 21 + //noinspection OldTargetApi + targetSdkVersion 34 versionCode 4 versionName "1.1.1" externalNativeBuild { - //ndkBuild { - // arguments "APP_PLATFORM=android-23" - // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' - //} cmake { - arguments "-DSDL_SHARED=ON", "-DANDROID_STL=c++_static", "-DHAVE_LD_VERSION_SCRIPT=OFF",'-DUSE_OPENGLES=ON' + arguments "-DANDROID_APPNAME=${applicationId}", "-DANDROID_APP_PLATFORM=android-21", "-DANDROID_STL=c++_static", "-DHAVE_LD_VERSION_SCRIPT=OFF", "-DUSE_OPENGLES=ON", "-DCMAKE_BUILD_TYPE=$elfBuildType" abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' - //abiFilters 'arm64-v8a' } } } @@ -34,9 +30,17 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.debug } } - applicationVariants.all { variant -> + buildFeatures { + buildConfig = true + } + namespace 'com.dishii.mm' + lint { + abortOnError false + } + applicationVariants.configureEach { variant -> tasks["merge${variant.name.capitalize()}Assets"] .dependsOn("externalNativeBuild${variant.name.capitalize()}") } @@ -45,26 +49,20 @@ android { jniLibs.srcDir 'libs' } externalNativeBuild { - //ndkBuild { - // path 'jni/Android.mk' - //} cmake { path '../../CMakeLists.txt' - version "3.25.1" + version "3.31.5" } } } - lintOptions { - abortOnError false - } - + if (buildAsLibrary) { libraryVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith(".aar")) { - def fileName = "org.libsdl.app.aar"; + def fileName = "com.dishii.mm.aar" output.outputFile = new File(outputFile.parent, fileName); } } @@ -74,13 +72,13 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.core:core:1.7.0' // Use the latest version - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.core:core:1.13.1' + implementation 'androidx.constraintlayout:constraintlayout:2.2.0' } -task wrapper(type: Wrapper) { - gradleVersion = '7.0.3' +tasks.register('wrapper', Wrapper) { + gradleVersion = '8.10.2' } -task prepareKotlinBuildScriptModel { +tasks.register('prepareKotlinBuildScriptModel') { } diff --git a/Android/app/gradle/wrapper/gradle-wrapper.jar b/Android/app/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7454180f2a..0000000000 Binary files a/Android/app/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/Android/app/gradle/wrapper/gradle-wrapper.properties b/Android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e750102e09..0000000000 --- a/Android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/Android/app/src/main/AndroidManifest.xml b/Android/app/src/main/AndroidManifest.xml index 72b36b6c5f..217a2744c1 100644 --- a/Android/app/src/main/AndroidManifest.xml +++ b/Android/app/src/main/AndroidManifest.xml @@ -3,7 +3,6 @@ com.gamemaker.game --> @@ -54,8 +53,8 @@ - + @@ -73,7 +72,8 @@ android:allowBackup="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" - android:appCategory="game" > + android:appCategory="game" + android:requestLegacyExternalStorage="true">