Skip to content

Commit 5165104

Browse files
committed
Fix android appcompat not set in template project
1 parent 056136c commit 5165104

File tree

8 files changed

+42
-27
lines changed

8 files changed

+42
-27
lines changed

core/platform/android/java/src/dev/axmol/lib/AxmolActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ of this software and associated documentation files (the "Software"), to deal
3030
import android.content.Intent;
3131
import android.content.pm.ApplicationInfo;
3232
import android.content.pm.PackageManager;
33-
import android.graphics.PixelFormat;
3433
import android.media.AudioManager;
3534
import android.opengl.GLSurfaceView;
3635
import android.os.Build;
@@ -52,7 +51,6 @@ of this software and associated documentation files (the "Software"), to deal
5251
import javax.microedition.khronos.egl.EGL10;
5352
import javax.microedition.khronos.egl.EGLConfig;
5453
import javax.microedition.khronos.egl.EGLDisplay;
55-
import javax.microedition.khronos.egl.EGLContext;
5654

5755
public abstract class AxmolActivity extends AppCompatActivity implements AxmolEngineListener {
5856
// ===========================================================

core/platform/android/libaxmol/axutils.gradle

Lines changed: 0 additions & 3 deletions
This file was deleted.

templates/common/proj.android/app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ android.applicationVariants.configureEach { variant ->
117117
dependencies {
118118
implementation fileTree(dir: 'libs', include: ['*.jar'])
119119
implementation project(':libaxmol')
120+
121+
def appcompat_ver = buildProfiles['appcompat']
122+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
120123
}
121124

122125
project.afterEvaluate {

tests/cpp-tests/proj.android/app/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
apply plugin: 'com.android.application'
2-
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2+
apply from: project(':libaxmol').projectDir.toString() + "/axmol.gradle"
33

4-
android {
5-
// Resolve build profiles
6-
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
4+
// Resolve build profiles
5+
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
6+
7+
android {
78
def packageName = buildProfiles['packageName']
89
def cmakeVer = buildProfiles['cmakeVer']
910
def cmakeOptions = Eval.me(buildProfiles['cmakeOptions'])
@@ -115,8 +116,8 @@ dependencies {
115116
implementation fileTree(dir: 'libs', include: ['*.jar'])
116117
implementation project(':libaxmol')
117118

118-
implementation 'androidx.appcompat:appcompat:1.7.0'
119-
//implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
119+
def appcompat_ver = buildProfiles['appcompat']
120+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
120121
}
121122

122123
project.afterEvaluate {

tests/fairygui-tests/proj.android/app/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
apply plugin: 'com.android.application'
2-
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2+
apply from: project(':libaxmol').projectDir.toString() + "/axmol.gradle"
33

4-
android {
5-
// Resolve build profiles
6-
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
4+
// Resolve build profiles
5+
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
6+
7+
android {
78
def packageName = buildProfiles['packageName']
89
def cmakeVer = buildProfiles['cmakeVer']
910
def cmakeOptions = Eval.me(buildProfiles['cmakeOptions'])
@@ -112,6 +113,9 @@ android.applicationVariants.configureEach { variant ->
112113
dependencies {
113114
implementation fileTree(dir: 'libs', include: ['*.jar'])
114115
implementation project(':libaxmol')
116+
117+
def appcompat_ver = buildProfiles['appcompat']
118+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
115119
}
116120

117121
project.afterEvaluate {

tests/live2d-tests/proj.android/app/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
apply plugin: 'com.android.application'
2-
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2+
apply from: project(':libaxmol').projectDir.toString() + "/axmol.gradle"
33

4-
android {
5-
// Resolve build profiles
6-
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
4+
// Resolve build profiles
5+
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
6+
7+
android {
78
def packageName = buildProfiles['packageName']
89
def cmakeVer = buildProfiles['cmakeVer']
910
def cmakeOptions = Eval.me(buildProfiles['cmakeOptions'])
@@ -112,6 +113,9 @@ android.applicationVariants.configureEach { variant ->
112113
dependencies {
113114
implementation fileTree(dir: 'libs', include: ['*.jar'])
114115
implementation project(':libaxmol')
116+
117+
def appcompat_ver = buildProfiles['appcompat']
118+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
115119
}
116120

117121
project.afterEvaluate {

tests/lua-tests/proj.android/app/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
apply plugin: 'com.android.application'
2-
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2+
apply from: project(':libaxmol').projectDir.toString() + "/axmol.gradle"
33

4-
android {
5-
// Resolve build profiles
6-
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
4+
// Resolve build profiles
5+
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
6+
7+
android {
78
def packageName = buildProfiles['packageName']
89
def cmakeVer = buildProfiles['cmakeVer']
910
def cmakeOptions = Eval.me(buildProfiles['cmakeOptions'])
@@ -112,6 +113,9 @@ android.applicationVariants.configureEach { variant ->
112113
dependencies {
113114
implementation fileTree(dir: 'libs', include: ['*.jar'])
114115
implementation project(':libaxmol')
116+
117+
def appcompat_ver = buildProfiles['appcompat']
118+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
115119
}
116120

117121
project.afterEvaluate {

tests/unit-tests/proj.android/app/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
apply plugin: 'com.android.application'
2-
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2+
apply from: project(':libaxmol').projectDir.toString() + "/axmol.gradle"
33

4-
android {
5-
// Resolve build profiles
6-
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
4+
// Resolve build profiles
5+
def buildProfiles = AxmolUtils.resolveBuildProfiles(project)
6+
7+
android {
78
def packageName = buildProfiles['packageName']
89
def cmakeVer = buildProfiles['cmakeVer']
910
def cmakeOptions = Eval.me(buildProfiles['cmakeOptions'])
@@ -114,6 +115,9 @@ android.applicationVariants.configureEach { variant ->
114115
dependencies {
115116
implementation fileTree(dir: 'libs', include: ['*.jar'])
116117
implementation project(':libaxmol')
118+
119+
def appcompat_ver = buildProfiles['appcompat']
120+
implementation "androidx.appcompat:appcompat:$appcompat_ver"
117121
}
118122

119123
project.afterEvaluate {

0 commit comments

Comments
 (0)