Skip to content

Commit

Permalink
3.6.27
Browse files Browse the repository at this point in the history
  • Loading branch information
cainhuang committed Apr 1, 2017
1 parent 2714d14 commit 98cfa66
Show file tree
Hide file tree
Showing 53 changed files with 1,829 additions and 1,382 deletions.
71 changes: 46 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cmake_minimum_required (VERSION 2.8)
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Profile" CACHE STRING "" FORCE)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)

set (BEHAVIAC_PACKAGE_VERSION 3.6.26)
set (BEHAVIAC_PACKAGE_VERSION 3.6.27)

#option( BUILD_SHARED_LIBS "set to OFF to build static libraries" ON )
SET(BUILD_SHARED_LIBS ON CACHE BOOL "set to OFF to build static libraries")
Expand Down Expand Up @@ -255,6 +255,12 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 14" AND CMAKE_SYSTEM_NAME MATCHES "VCM
set (BEHAVIAC_ANDROID_ON 1)
endif()

set (BEHAVIAC_ANDROID_STUDIO 0)

if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_SYSTEM_NAME MATCHES "Android")
set (BEHAVIAC_ANDROID_STUDIO 1)
endif()

set (COMPILE_POSTFIX "")


Expand Down Expand Up @@ -295,8 +301,11 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Woverloaded-virtual -Wnon-virtual-dtor -Wfloat-equal -Wno-unused-local-typedefs -finput-charset=UTF-8 ")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")

endif()
endif()

# if (BEHAVIAC_ANDROID_STUDIO)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mxgot")
# endif()

# if(CMAKE_GENERATOR STREQUAL Xcode)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-private-field")
Expand Down Expand Up @@ -341,7 +350,13 @@ foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${LIB_OUTPUT_PATH} )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )

add_library(libbehaviac ${BEHAVIAC_INC} ${BEHAVIAC_SRC} ${LINKER_SCRIPT})
set( SHARED_LIB "" )

if (BEHAVIAC_ANDROID_STUDIO)
set( SHARED_LIB "SHARED" )
endif()

add_library(libbehaviac ${SHARED_LIB} ${BEHAVIAC_INC} ${BEHAVIAC_SRC} ${LINKER_SCRIPT})

set_target_properties(libbehaviac PROPERTIES PREFIX "")
# set_target_properties(libbehaviac PROPERTIES OUTPUT_NAME_DEBUG libbehaviac${${CMAKE_DEBUG_POSTFIX}}
Expand All @@ -360,6 +375,10 @@ set_target_properties(libbehaviac PROPERTIES RELEASE_POSTFIX ${CMAKE_RELEASE_POS
# # RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BINARY_PATH})
# endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )

if (BEHAVIAC_ANDROID_STUDIO)
target_link_libraries(libbehaviac log android)
endif()

# Cmake comes with a builtin add_definitions command to add definitions to
# everything in the current directory, but we need to add definitions to
# targets.
Expand Down Expand Up @@ -388,26 +407,28 @@ else()
message( STATUS "build static libs" )
endif()

add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btunittest")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btremotetest")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/demo_running")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/usertest")
if (NOT BEHAVIAC_ANDROID_STUDIO)
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btunittest")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btremotetest")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/demo_running")
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/usertest")

if (MSVC)
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btperformance")
if (EXISTS "${PROJECT_SOURCE_DIR}/example/spaceship")
add_subdirectory ("${PROJECT_SOURCE_DIR}/example/spaceship")
endif()
endif()
if (MSVC)
add_subdirectory ("${PROJECT_SOURCE_DIR}/test/btperformance")
if (EXISTS "${PROJECT_SOURCE_DIR}/example/spaceship")
add_subdirectory ("${PROJECT_SOURCE_DIR}/example/spaceship")
endif()
endif()

#add_subdirectory ("${PROJECT_SOURCE_DIR}/example/airbattledemo")

add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1_1/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1_2/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_2/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_3/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_4/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_5/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_6/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_7/cpp")
#add_subdirectory ("${PROJECT_SOURCE_DIR}/example/airbattledemo")

add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1_1/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_1_2/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_2/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_3/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_4/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_5/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_6/cpp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/tutorials/tutorial_7/cpp")
endif()
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Tencent/behaviac/blob/master/license.txt)
[![Release Version](https://img.shields.io/badge/release-3.6.26-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Updates](https://img.shields.io/badge/Platform-iOS | Android | Windows | Linux | Unity -brightgreen.svg)](https://github.com/Tencent/behaviac/blob/master/history.txt)
[![Release Version](https://img.shields.io/badge/release-3.6.27-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Updates](https://img.shields.io/badge/Platform-%20iOS%20%7C%20OS%20X%20%7C%20Android%20%7C%20Windows%20%7C%20Linux%20-brightgreen.svg)](https://github.com/Tencent/behaviac/blob/master/history.txt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/behaviac/pulls)

##[访问http://www.behaviac.com/获取文档,教程,API,FAQ,源码,下载等一切相关资料](http://www.behaviac.com/)
Expand Down
9 changes: 9 additions & 0 deletions build/android_studio/behaviac_android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
1 change: 1 addition & 0 deletions build/android_studio/behaviac_android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
43 changes: 43 additions & 0 deletions build/android_studio/behaviac_android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.tencent.behaviac.behaviac_android"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'x86'//, 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips64'
}
externalNativeBuild {
cmake {
cppFlags ""
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "../../../../CMakeLists.txt"
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
}
25 changes: 25 additions & 0 deletions build/android_studio/behaviac_android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.tencent.behaviac.behaviac_android;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.tencent.behaviac.behaviac_android", appContext.getPackageName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tencent.behaviac.behaviac_android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<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,11 @@
#include <jni.h>
#include <string>

extern "C"
JNIEXPORT jstring JNICALL
Java_com_tencent_behaviac_behaviac_1android_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
return env->NewStringUTF(hello.c_str());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.tencent.behaviac.behaviac_android;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
}

/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
public native String stringFromJNI();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tencent.behaviac.behaviac_android.MainActivity">

<TextView
android:id="@+id/sample_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>
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.
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.
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,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">behaviac_android</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.tencent.behaviac.behaviac_android;

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() throws Exception {
assertEquals(4, 2 + 2);
}
}
23 changes: 23 additions & 0 deletions build/android_studio/behaviac_android/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()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'

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

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Loading

0 comments on commit 98cfa66

Please sign in to comment.