mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[CI]: build MobileGL android renderer plugin
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
name: MobileGL Plugin APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
- Feat/Backend-Direct-GLES
|
||||||
|
- Feat/Backend-Direct-Vulkan
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Set artifact metadata
|
||||||
|
run: |
|
||||||
|
echo "date_today=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
|
||||||
|
echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: zulu
|
||||||
|
java-version: '17'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
with:
|
||||||
|
gradle-version: 8.10.2
|
||||||
|
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
|
||||||
|
- name: Install Android NDK
|
||||||
|
run: |
|
||||||
|
sdkmanager "ndk;27.3.13750724"
|
||||||
|
echo "ndk.dir=$ANDROID_HOME/ndk/27.3.13750724" >> android-plugin/local.properties
|
||||||
|
|
||||||
|
- name: Update glslang external sources
|
||||||
|
working-directory: 3rdparty/glslang
|
||||||
|
run: python update_glslang_sources.py
|
||||||
|
|
||||||
|
- name: Build plugin APK
|
||||||
|
run: gradle --no-daemon -p android-plugin :app:assembleRelease
|
||||||
|
|
||||||
|
- name: Upload plugin APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: MobileGL-plugin-${{ env.date_today }}-${{ env.short_sha }}
|
||||||
|
path: android-plugin/app/build/outputs/apk/release/*.apk
|
||||||
+4
-1
@@ -18,4 +18,7 @@ MobileGL/MG_Test/build
|
|||||||
/cmake-build*
|
/cmake-build*
|
||||||
.idea
|
.idea
|
||||||
MobileGL/MG*/build*
|
MobileGL/MG*/build*
|
||||||
MobileGL/MG*/cmake-build*
|
MobileGL/MG*/cmake-build*
|
||||||
|
/android-plugin/.gradle
|
||||||
|
/android-plugin/build
|
||||||
|
/android-plugin/app/build
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.application'
|
||||||
|
}
|
||||||
|
|
||||||
|
def mobileGlEnv = [
|
||||||
|
LIBGL_ES : '3',
|
||||||
|
POJAV_RENDERER : 'opengles3',
|
||||||
|
MOBILEGL_BACKEND_TYPE: 'DirectGLES',
|
||||||
|
]
|
||||||
|
|
||||||
|
def mobileGlEnvString = mobileGlEnv.collect { key, value -> "${key}=${value}" }.join(':')
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace 'top.mobilegl.plugin'
|
||||||
|
compileSdk 34
|
||||||
|
ndkVersion '27.3.13750724'
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId 'top.mobilegl.plugin'
|
||||||
|
minSdk 26
|
||||||
|
targetSdk 34
|
||||||
|
versionCode 1
|
||||||
|
versionName 'dev'
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
abiFilters 'arm64-v8a'
|
||||||
|
}
|
||||||
|
|
||||||
|
manifestPlaceholders = [
|
||||||
|
des : 'MobileGL',
|
||||||
|
renderer: 'MobileGL:libMobileGL.so:/libMobileGL.so',
|
||||||
|
boatEnv : mobileGlEnvString,
|
||||||
|
pojavEnv: mobileGlEnvString,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packaging {
|
||||||
|
jniLibs {
|
||||||
|
useLegacyPackaging true
|
||||||
|
excludes += ['**/libSPIRV-Tools-shared.so']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':MobileGL')
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:hasCode="true"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/Theme.MobileGLPlugin">
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".PluginActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:theme="@style/Theme.MobileGLPlugin.NoDisplay">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="fclPlugin"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="des"
|
||||||
|
android:value="${des}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="renderer"
|
||||||
|
android:value="${renderer}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="boatEnv"
|
||||||
|
android:value="${boatEnv}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="pojavEnv"
|
||||||
|
android:value="${pojavEnv}" />
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package top.mobilegl.plugin;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
public final class PluginActivity extends Activity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">MobileGL</string>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="Theme.MobileGLPlugin" parent="@android:style/Theme.Material.NoActionBar" />
|
||||||
|
<style name="Theme.MobileGLPlugin.NoDisplay" parent="@android:style/Theme.NoDisplay" />
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.application' version '8.6.0' apply false
|
||||||
|
id 'com.android.library' version '8.6.0' apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects { subproject ->
|
||||||
|
subproject.plugins.withId('com.android.library') {
|
||||||
|
subproject.android.defaultConfig.ndk.abiFilters.clear()
|
||||||
|
subproject.android.defaultConfig.ndk.abiFilters.add('arm64-v8a')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = 'MobileGLPlugin'
|
||||||
|
include ':app'
|
||||||
|
include ':MobileGL'
|
||||||
|
project(':MobileGL').projectDir = file('..')
|
||||||
Reference in New Issue
Block a user