From fb135a4f329865103594bfb73c073296c52c4d98 Mon Sep 17 00:00:00 2001 From: Egor Date: Thu, 15 Feb 2018 23:14:40 -0800 Subject: Unified Android build --- unityplugin/Android/GhostCubeScene/build.gradle | 28 +++++----------- .../GhostCubeScene/src/main/AndroidManifest.xml | 6 ++-- .../ghostcubescene/GhostCubeSceneApplication.java | 22 +++++++++++++ .../GhostCubeSceneNativeActivity.java | 36 +++++++++++++++++++++ .../GhostCubeScene/src/main/res/layout/widgets.xml | 17 ---------- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 6332 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 3611 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 9400 -> 0 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 16510 -> 0 bytes .../src/main/res/values-v11/styles.xml | 11 ------- .../src/main/res/values-v14/styles.xml | 12 ------- .../GhostCubeScene/src/main/res/values/strings.xml | 1 - .../GhostCubeScene/src/main/res/values/styles.xml | 20 ------------ unityplugin/Android/settings.gradle | 3 +- 14 files changed, 71 insertions(+), 85 deletions(-) create mode 100644 unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneApplication.java create mode 100644 unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneNativeActivity.java delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/layout/widgets.xml delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/values-v11/styles.xml delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/values-v14/styles.xml delete mode 100644 unityplugin/Android/GhostCubeScene/src/main/res/values/styles.xml (limited to 'unityplugin/Android') diff --git a/unityplugin/Android/GhostCubeScene/build.gradle b/unityplugin/Android/GhostCubeScene/build.gradle index 26d54c3..319cd99 100644 --- a/unityplugin/Android/GhostCubeScene/build.gradle +++ b/unityplugin/Android/GhostCubeScene/build.gradle @@ -4,40 +4,28 @@ android { compileSdkVersion = 27 defaultConfig { - applicationId = 'com.DiligentGraphics.UnityEmulator.UnityEmulatorApplication' + applicationId = 'com.diligentengine.unityemulator.ghostcubescene.GhostCubeSceneApplication' minSdkVersion 21 targetSdkVersion 25 - ndk { - abiFilters 'armeabi-v7a'//, 'armeabi', 'arm64-v8a','x86', 'x86_64' - } - externalNativeBuild { - cmake { - arguments '-DANDROID_PLATFORM=android-21', - '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static' - } - } } buildTypes { - release { - minifyEnabled = false - proguardFiles getDefaultProguardFile('proguard-android.txt'), - 'proguard-rules.pro' - } - } - externalNativeBuild { - cmake { - path '../../../CMakeLists.txt' + release { + minifyEnabled = false + proguardFiles getDefaultProguardFile('proguard-android.txt'), + 'proguard-rules.pro' } } sourceSets { main { - java.srcDirs = ['../Common/Java'] assets.srcDirs = ['../../GhostCubeScene/assets'] } } } +buildDir '../build/GhostCubeScene' + dependencies { + implementation project(":Common") implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:25.4.0' implementation 'com.android.support.constraint:constraint-layout:1.0.1' diff --git a/unityplugin/Android/GhostCubeScene/src/main/AndroidManifest.xml b/unityplugin/Android/GhostCubeScene/src/main/AndroidManifest.xml index bc885c2..e6f0ea7 100644 --- a/unityplugin/Android/GhostCubeScene/src/main/AndroidManifest.xml +++ b/unityplugin/Android/GhostCubeScene/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ @@ -11,12 +11,12 @@ android:versionName="1.0" > android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" - android:name="com.DiligentGraphics.UnityEmulator.UnityEmulatorApplication" + android:name="com.diligentengine.unityemulator.ghostcubescene.GhostCubeSceneApplication" > - diff --git a/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneApplication.java b/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneApplication.java new file mode 100644 index 0000000..d099138 --- /dev/null +++ b/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneApplication.java @@ -0,0 +1,22 @@ +/* + * Copyright 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.diligentengine.unityemulator.ghostcubescene; +import com.diligentengine.android.common.DiligentApplicationBase; + +public class GhostCubeSceneApplication extends DiligentApplicationBase { + +} diff --git a/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneNativeActivity.java b/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneNativeActivity.java new file mode 100644 index 0000000..405647c --- /dev/null +++ b/unityplugin/Android/GhostCubeScene/src/main/java/com/diligentengine/unityemulator/ghostcubescene/GhostCubeSceneNativeActivity.java @@ -0,0 +1,36 @@ +/* + * Copyright 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.diligentengine.unityemulator.ghostcubescene; +import com.diligentengine.android.common.NativeActivityBase; +import android.os.Bundle; +import android.util.Log; + +public class GhostCubeSceneNativeActivity extends NativeActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + String pluginName = getString(R.string.plugin_name); + try { + System.loadLibrary(pluginName); + Log.i("native-activity", "Loaded " + pluginName + " plugin\n"); + } catch (UnsatisfiedLinkError e) { + Log.e("native-activity", "Failed to load " + pluginName + " plugin\n" + e); + } + } +} diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/layout/widgets.xml b/unityplugin/Android/GhostCubeScene/src/main/res/layout/widgets.xml deleted file mode 100644 index b6e86e6..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/layout/widgets.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-hdpi/ic_launcher.png b/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 5a261ea..0000000 Binary files a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-mdpi/ic_launcher.png b/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 74263d9..0000000 Binary files a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xhdpi/ic_launcher.png b/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index da6a331..0000000 Binary files a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xxhdpi/ic_launcher.png b/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index e587387..0000000 Binary files a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/values-v11/styles.xml b/unityplugin/Android/GhostCubeScene/src/main/res/values-v11/styles.xml deleted file mode 100644 index 541752f..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/values-v14/styles.xml b/unityplugin/Android/GhostCubeScene/src/main/res/values-v14/styles.xml deleted file mode 100644 index f20e015..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/values/strings.xml b/unityplugin/Android/GhostCubeScene/src/main/res/values/strings.xml index 546c209..c70243e 100644 --- a/unityplugin/Android/GhostCubeScene/src/main/res/values/strings.xml +++ b/unityplugin/Android/GhostCubeScene/src/main/res/values/strings.xml @@ -2,6 +2,5 @@ Ghost Cube Scene Unity Emulator GhostCubePlugin - 0.0 FPS \ No newline at end of file diff --git a/unityplugin/Android/GhostCubeScene/src/main/res/values/styles.xml b/unityplugin/Android/GhostCubeScene/src/main/res/values/styles.xml deleted file mode 100644 index 4a10ca4..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/unityplugin/Android/settings.gradle b/unityplugin/Android/settings.gradle index 38b61d6..1eb90a3 100644 --- a/unityplugin/Android/settings.gradle +++ b/unityplugin/Android/settings.gradle @@ -1 +1,2 @@ -include ':GhostCubeScene' +include 'Common', ':GhostCubeScene' +project(':Common').projectDir = new File(settingsDir, '../../Common/NativeApp/Android') -- cgit v1.2.3