Browse Source

Merge branch 'master' of https://github.com/taylor001/crown

Daniele Bartolini 12 years ago
parent
commit
1dc5cfebc8
2 changed files with 48 additions and 5 deletions
  1. 38 0
      engine/os/android/Config.h
  2. 10 5
      utils/crown-android.rb

+ 38 - 0
engine/os/android/Config.h

@@ -0,0 +1,38 @@
+/*
+Copyright (c) 2013 Daniele Bartolini, Michele Rossi
+Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#define CROWN_VERSION_MAJOR 0 
+#define CROWN_VERSION_MINOR 1 
+#define CROWN_VERSION_MICRO 11 
+
+#define ANDROID
+
+#ifdef ANDROID
+	#define PRId64 "lld"
+	#define PRIu64 "llu"
+	#define PRIi64 "lli"
+	#define PRIx64 "llx"
+#endif

+ 10 - 5
utils/crown-android.rb

@@ -33,6 +33,7 @@ $package			= "crown.android"
 
 $engine_src 		= "../engine/."
 $android_src		= "../engine/os/android/*.java"
+$config_src			= "../engine/os/android/Config.h"
 $manifest			= "../engine/os/android/AndroidManifest.xml"
 
 $luajit				= "../engine/third/ARMv7/luajit"
@@ -140,6 +141,10 @@ def fill_android_project(path)
 	FileUtils.cp_r($engine_src, engine_dest, :remove_destination => true)
 	print "Copied Engine to " + engine_dest + "\n"
 
+	# Copy android Config.h
+	FileUtils.cp($config_src, engine_dest)
+	print "Copied Config.h to " + engine_dest + "\n"
+
 	# Copy luajit dir
 	FileUtils.cp_r($luajit, engine_dest, :remove_destination => true)
 	print "Copied luajit dir to " + engine_dest + "\n"
@@ -162,14 +167,14 @@ def build_android_project(path)
 	# Move to root directory of Android project
 	Dir.chdir(path)
 	# Build libraries
-	if system("ndk-build") != 0
-		print "Critical Error: Unable to build android project libraries\n"
+	if not system("ndk-build")
+		print "Critical error: Unable to build crown libraries"
 		return
 	end
 	# Build apk
-	if system("ant debug") != 0
-		print "Critical Error: Unable to build android apk\n"
-		return 
+	if not system("ant debug")
+		print "Critical error: Unable to build crown project"
+		return
 	end
 end