update sth for pad

This commit is contained in:
zhl 2023-04-12 18:54:00 +08:00
parent 132c24eda4
commit 844006ed16
12 changed files with 36 additions and 143 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,8 +9,19 @@ plugins {
android {
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
buildToolsVersion PROP_BUILD_TOOLS_VERSION
// assetPacks = [":install-time-asset_pack"] //PAD资源分发
assetPacks = [":UnityDataAssetPack"] //PAD资源分发
ndkVersion "21.3.6528147"
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}
defaultConfig {
applicationId "com.cege.games.release"
@ -97,24 +108,24 @@ android {
}
}
android.applicationVariants.all { variant ->
//android.applicationVariants.all { variant ->
// delete previous files first
delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
variant.mergeAssetsProvider.get().doLast {
def sourceDir = rootProject.ext.cfgs.jsFilePath
copy{
from "${sourceDir}"
include "Data/js/**"
into outputDir
}
copy {
from "${sourceDir}/cert/cacert.pem"
into outputDir
}
}
}
// delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
//
// variant.mergeAssetsProvider.get().doLast {
// def sourceDir = rootProject.ext.cfgs.jsFilePath
//
// copy{
// from "${sourceDir}"
// include "Data/js/**"
// into outputDir
// }
// copy {
// from "${sourceDir}/cert/cacert.pem"
// into outputDir
// }
// }
//}
dependencies {

View File

@ -77,6 +77,7 @@ import org.cocos2dx.lib.Cocos2dxHelper;
import org.cocos2dx.lib.CocosJSHelper;
import org.json.JSONException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -156,10 +157,6 @@ public class MainActivity extends UnityPlayerActivity
private FirebaseAnalytics mFirebaseAnalytics;
private AppEventsLogger fbLogger;
protected String updateUnityCommandLineArguments(String cmdLine) {
return cmdLine;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -168,9 +165,6 @@ public class MainActivity extends UnityPlayerActivity
// Obtain the FirebaseAnalytics instance.
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
String cmdLine = updateUnityCommandLineArguments(getIntent().getStringExtra("unity"));
getIntent().putExtra("unity", cmdLine);
onLoadNativeLibraries();
app = this;
Cocos2dxHelper.init(this);

View File

@ -22,10 +22,10 @@ android.enableJetifier=true
PROP_COMPILE_SDK_VERSION=30
# Android SDK version that will be used as the earliest version of android this application can run on
PROP_MIN_SDK_VERSION=22
PROP_MIN_SDK_VERSION=26
# Android SDK version that will be used as the latest version of android this application has been tested on
PROP_TARGET_SDK_VERSION=31
PROP_TARGET_SDK_VERSION=30
# Android Build Tools version that will be used as the compile project
PROP_BUILD_TOOLS_VERSION=30.0.2

View File

@ -1 +0,0 @@
/build

View File

@ -1,44 +0,0 @@
plugins {
id 'com.android.library'
}
apply plugin: 'com.android.asset-pack'
assetPack{
packName = "install_time_asset_pack"
dynamicDelivery{
deliveryType = "install-time" //PAD资源分发
}
}
android {
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
defaultConfig {
minSdkVersion 21
targetSdkVersion 32
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

View File

@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -1,26 +0,0 @@
package com.example.mylibrary;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.mylibrary.test", appContext.getPackageName());
}
}

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mylibrary">
</manifest>

View File

@ -1,17 +0,0 @@
package com.example.mylibrary;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -3,7 +3,9 @@ include ':app'
rootProject.name = "HeadlessCocos"
include ':libcocos2dx'
project(':libcocos2dx').projectDir = new File(ext.cfgs.cocos2dxBasePath + '/cocos/platform/android/libcocos2dx')
include ':install-time-asset_pack'
include ':UnityDataAssetPack'
project(':UnityDataAssetPack').projectDir = new File(ext.cfgs.unityAndroidProject + '/UnityDataAssetPack')
include ':unityLibrary'
project(':unityLibrary').projectDir = new File(ext.cfgs.unityAndroidProject + '/unityLibrary')