diff options
| author | Egor <egor.yusov@gmail.com> | 2018-02-16 07:14:40 +0000 |
|---|---|---|
| committer | Egor <egor.yusov@gmail.com> | 2018-02-16 07:14:40 +0000 |
| commit | fb135a4f329865103594bfb73c073296c52c4d98 (patch) | |
| tree | a1757579b0fe9f14dc060ed1e4de9f45bfa33de1 /unityplugin/Android | |
| parent | Updated tools submodule (diff) | |
| download | DiligentEngine-fb135a4f329865103594bfb73c073296c52c4d98.tar.gz DiligentEngine-fb135a4f329865103594bfb73c073296c52c4d98.zip | |
Unified Android build
Diffstat (limited to 'unityplugin/Android')
14 files changed, 71 insertions, 85 deletions
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 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" -package="com.DiligentGraphics.UnityEmulator" +package="com.diligentengine.unityemulator.ghostcubescene" android:versionCode="1" android:versionName="1.0" > @@ -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" > <!-- Our activity is the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --> - <activity android:name="com.DiligentGraphics.UnityEmulator.UnityEmulatorNativeActivity" + <activity android:name="com.diligentengine.unityemulator.ghostcubescene.GhostCubeSceneNativeActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"> <!-- Tell NativeActivity the name of our .so --> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="top" - android:orientation="vertical" > - - <TextView - android:id="@+id/textViewFPS" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="end" - android:text="@string/fps" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="@android:color/white" /> - -</LinearLayout>
\ 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 Binary files differdeleted file mode 100644 index 5a261ea..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-hdpi/ic_launcher.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 74263d9..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-mdpi/ic_launcher.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index da6a331..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xhdpi/ic_launcher.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index e587387..0000000 --- a/unityplugin/Android/GhostCubeScene/src/main/res/mipmap-xxhdpi/ic_launcher.png +++ /dev/null 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 @@ -<resources> - - <!-- - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> - <!-- API 11 theme customizations can go here. --> - </style> - -</resources>
\ 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 @@ -<resources> - - <!-- - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> - <!-- API 14 theme customizations can go here. --> - </style> - -</resources>
\ 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 @@ <string name="app_name">Ghost Cube Scene Unity Emulator</string> <string name="plugin_name">GhostCubePlugin</string> - <string name="fps">0.0 FPS</string> </resources>
\ 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 @@ -<resources> - - <!-- - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Light"> - <!-- - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - --> - </style> - - <!-- Application theme. --> - <style name="AppTheme" parent="AppBaseTheme"> - <!-- All customizations that are NOT specific to a particular API-level can go here. --> - </style> - -</resources>
\ 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') |
