Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build//
*.opensdf
Debug/
Release/
ipch/
Debug_Shared/
Release_Shared/
Debug_ANGLE/
Expand All @@ -29,3 +30,13 @@ ipch/
.vs
**/vc2013/enc_temp_folder/**
**/vc2015/enc_temp_folder/**

# Android cruft
*.swp
.idea
*.iml
local.properties
proguard-rules.pro
.gradle/
jniLibs/
build/
133 changes: 133 additions & 0 deletions samples/Basic/androidstudio/BasicApp/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
apply plugin: 'com.android.application'
apply plugin: org.libcinder.gradle.CinderAppBuildPlugin

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

println "PROJECT DIR: ${projectDir}"
println "BUILD DIR : ${buildDir}"

defaultConfig {
applicationId "org.libcinder.samples.basicapp"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main {
jni.srcDirs = ['src/main/jni', '../../../src', '../../../include']
jniLibs.srcDirs = ['src/main/jniLibs', '../../../../../lib']
assets.srcDirs = ['src/main/assets', '../../../assets']
}
}

task cinderCleanNdk() << {
File cinderNdkDir = new File( "${project.buildDir}/cinder-ndk" );
if( cinderNdkDir.exists() ) {
cinderNdkDir.delete();
}

tasks.each {
if(("cinderCompileDebugNdk" == it.name) || ("cinderCompileReleaseNdk" == it.name)) {
it.outputs.upToDateWhen {false}
}
}
}

def cleanBuildTask = tasks.getByPath( ":app:clean" );
if( cleanBuildTask ) {
cleanBuildTask.dependsOn cinderCleanNdk
}

task disableDefaultNdkBuild() {
doFirst {
tasks.each {
if(("compileDebugNdk" == it.name) || ("compileReleaseNdk" == it.name)) {
it.enabled = false
}
}
}
}

def prebuildTask = tasks.getByPath( ":app:preBuild" )
if( prebuildTask ) {
prebuildTask.dependsOn disableDefaultNdkBuild
}

cinder {
ndkDir = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder().toString()
cinderDir = "${projectDir}/../../../../../../.."
verbose = false
moduleName = "BasicApp"
srcDirs = ["../../../src",
"../../../../../src",
"../../../../../lib/imgui",
]
cFlags {
"all_archs" {
debug = "-g"
release = "-Os"
}
}
cppFlags {
"all_archs" {
debug = "-g -std=c++11"
release = "-Os -std=c++11"
}
}
includeDirs = [
"../../../../../include",
"../../../../../lib/imgui",
"${cinderDir}/include", "${cinderDir}/boost"]
ldLibs = ["log", "android", "EGL", "GLESv3", "OpenSLES", "z"]
libCinder = [
"debug" : "${cinderDir}/lib/android/\$(TARGET_PLATFORM)/\$(TARGET_ARCH_ABI)/libcinder_d.a",
"release" : "${cinderDir}/lib/android/\$(TARGET_PLATFORM)/\$(TARGET_ARCH_ABI)/libcinder.a"
]
staticLibs = [
"${cinderDir}/lib/android/\$(TARGET_PLATFORM)/\$(TARGET_ARCH_ABI)/libboost_filesystem.a",
"${cinderDir}/lib/android/\$(TARGET_PLATFORM)/\$(TARGET_ARCH_ABI)/libboost_system.a"
]
stl = "gnustl_static"
toolChainVersion = "4.9"
archs = ["armeabi-v7a"]
//archs = ["armeabi", "armeabi-v7a", "arm64-v8a", "mips", "mips64", "x86","x86_64"]
}

task ndkBuildDebug(dependsOn: 'cinderCompileDebugNdk') {}
task ndkBuildRelease(dependsOn: 'cinderCompileReleaseNdk') {}

tasks.withType(JavaCompile) {
compileTask ->
if("compileDebugJavaWithJavac" == compileTask.name) {
compileTask.dependsOn ndkBuildDebug
}
else if("compileReleaseJavaWithJavac" == compileTask.name) {
compileTask.dependsOn ndkBuildRelease
}
}
}

repositories {
jcenter()
flatDir {
dirs "${projectDir}/../../../../../../../lib/android"
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
debugCompile 'org.libcinder:libcinder-debug:1.0@aar'
releaseCompile 'org.libcinder:libcinder-release:1.0@aar'
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libcinder.samples.basicapp" >

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
<activity
android:name=".BasicAppActivity"
android:label="@string/app_name" >
<!-- Tell NativeActivity the name of or .so -->
<meta-data android:name="android.app.lib_name"
android:value="BasicApp" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.libcinder.samples.basicapp;

import org.libcinder.app.CinderNativeActivity;

public class BasicAppActivity extends CinderNativeActivity {
static final String TAG = "BasicAppActivity";
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light">
</style>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">BasicApp</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>

</resources>
23 changes: 23 additions & 0 deletions samples/Basic/androidstudio/BasicApp/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
flatDir {
dirs "${projectDir}/../../../../../../tools/android/CinderAppBuild/repo"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'org.libcinder.gradle:cinderappbuild:1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Loading