Repository: nfrechette/acl (cpp)

Issue:
Change android package names for tools
Because they all have the same `com.acl` package name, when we deploy to a phone, they get constantly overwritten which is annoying.


Discussion:

Patch:
diff --git a/tools/acl_compressor/main_android/AndroidManifest.xml b/tools/acl_compressor/main_android/AndroidManifest.xml
--- a/tools/acl_compressor/main_android/AndroidManifest.xml
+++ b/tools/acl_compressor/main_android/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.acl"
+      package="com.acl.compressor"
       android:versionCode="1"
       android:versionName="1.0">
     <uses-sdk android:minSdkVersion="3" />
diff --git a/tools/acl_compressor/main_android/CMakeLists.txt b/tools/acl_compressor/main_android/CMakeLists.txt
--- a/tools/acl_compressor/main_android/CMakeLists.txt
+++ b/tools/acl_compressor/main_android/CMakeLists.txt
@@ -36,7 +36,7 @@ file(GLOB_RECURSE ALL_MAIN_SOURCE_FILES LIST_DIRECTORIES false
 create_source_groups("${ALL_MAIN_SOURCE_FILES}" ${PROJECT_SOURCE_DIR})
 
 # Add resource files
-set(JAVA_FILES java/com/acl/MainActivity.java)
+set(JAVA_FILES java/com/acl/compressor/MainActivity.java)
 set(RESOURCE_FILES res/values/strings.xml)
 set(ANDROID_FILES AndroidManifest.xml)
 
diff --git a/tools/acl_compressor/main_android/java/com/acl/MainActivity.java b/tools/acl_compressor/main_android/java/com/acl/compressor/MainActivity.java
similarity index 95%
rename from tools/acl_compressor/main_android/java/com/acl/MainActivity.java
rename to tools/acl_compressor/main_android/java/com/acl/compressor/MainActivity.java
--- a/tools/acl_compressor/main_android/java/com/acl/MainActivity.java
+++ b/tools/acl_compressor/main_android/java/com/acl/compressor/MainActivity.java
@@ -1,4 +1,4 @@
-package com.acl;
+package com.acl.compressor;
 
 import android.app.Activity;
 import android.widget.TextView;
diff --git a/tools/acl_compressor/main_android/jni/main.cpp b/tools/acl_compressor/main_android/jni/main.cpp
--- a/tools/acl_compressor/main_android/jni/main.cpp
+++ b/tools/acl_compressor/main_android/jni/main.cpp
@@ -26,7 +26,7 @@
 
 #include <jni.h>
 
-extern "C" jint Java_com_acl_MainActivity_nativeMain(JNIEnv* env, jobject caller)
+extern "C" jint Java_com_acl_compressor_MainActivity_nativeMain(JNIEnv* env, jobject caller)
 {
 	char* argv[1] = { nullptr };
 	return main_impl(0, argv);
diff --git a/tools/acl_decompressor/main_android/CMakeLists.txt b/tools/acl_decompressor/main_android/CMakeLists.txt
--- a/tools/acl_decompressor/main_android/CMakeLists.txt
+++ b/tools/acl_decompressor/main_android/CMakeLists.txt
@@ -50,7 +50,7 @@ file(GLOB_RECURSE ALL_MAIN_SOURCE_FILES LIST_DIRECTORIES false ${PROJECT_SOURCE_
 create_source_groups("${ALL_MAIN_SOURCE_FILES}" ${PROJECT_SOURCE_DIR})
 
 # Add resource files
-set(JAVA_FILES java/com/acl/MainActivity.java)
+set(JAVA_FILES java/com/acl/decompressor/MainActivity.java)
 set(RESOURCE_FILES "${PROJECT_RESOURCE_DIR}/values/strings.xml")
 set(ANDROID_FILES "${PROJECT_BINARY_DIR}/AndroidManifest.xml")
 
diff --git a/tools/acl_decompressor/main_android/java/com/acl/MainActivity.java b/tools/acl_decompressor/main_android/java/com/acl/decompressor/MainActivity.java
similarity index 96%
rename from tools/acl_decompressor/main_android/java/com/acl/MainActivity.java
rename to tools/acl_decompressor/main_android/java/com/acl/decompressor/MainActivity.java
--- a/tools/acl_decompressor/main_android/java/com/acl/MainActivity.java
+++ b/tools/acl_decompressor/main_android/java/com/acl/decompressor/MainActivity.java
@@ -1,4 +1,4 @@
-package com.acl;
+package com.acl.decompressor;
 
 import android.app.Activity;
 import android.content.res.AssetManager;
diff --git a/tools/acl_decompressor/main_android/jni/main.cpp b/tools/acl_decompressor/main_android/jni/main.cpp
--- a/tools/acl_decompressor/main_android/jni/main.cpp
+++ b/tools/acl_decompressor/main_android/jni/main.cpp
@@ -102,7 +102,7 @@ static int read_metadata(AAssetManager* asset_manager, std::vector<std::string>&
 	return result;
 }
 
-extern "C" jint Java_com_acl_MainActivity_nativeMain(JNIEnv* env, jobject caller, jobject java_asset_manager, jstring java_output_directory)
+extern "C" jint Java_com_acl_decompressor_MainActivity_nativeMain(JNIEnv* env, jobject caller, jobject java_asset_manager, jstring java_output_directory)
 {
 	AAssetManager* asset_manager = AAssetManager_fromJava(env, java_asset_manager);
 
diff --git a/tools/regression_tester_android/CMakeLists.txt b/tools/regression_tester_android/CMakeLists.txt
--- a/tools/regression_tester_android/CMakeLists.txt
+++ b/tools/regression_tester_android/CMakeLists.txt
@@ -50,7 +50,7 @@ file(GLOB_RECURSE ALL_MAIN_SOURCE_FILES LIST_DIRECTORIES false ${PROJECT_SOURCE_
 create_source_groups("${ALL_MAIN_SOURCE_FILES}" ${PROJECT_SOURCE_DIR})
 
 # Add resource files
-set(JAVA_FILES java/com/acl/MainActivity.java)
+set(JAVA_FILES java/com/acl/regression_tests/MainActivity.java)
 set(RESOURCE_FILES "${PROJECT_RESOURCE_DIR}/values/strings.xml")
 set(ANDROID_FILES "${PROJECT_BINARY_DIR}/AndroidManifest.xml")
 
diff --git a/tools/regression_tester_android/jni/main.cpp b/tools/regression_tester_android/jni/main.cpp
--- a/tools/regression_tester_android/jni/main.cpp
+++ b/tools/regression_tester_android/jni/main.cpp
@@ -102,7 +102,7 @@ static int read_metadata(AAssetManager* asset_manager, std::vector<std::string>&
 	return result;
 }
 
-extern "C" jint Java_com_acl_MainActivity_nativeMain(JNIEnv* env, jobject caller, jobject java_asset_manager)
+extern "C" jint Java_com_acl_regression_1tests_MainActivity_nativeMain(JNIEnv* env, jobject caller, jobject java_asset_manager)
 {
 	AAssetManager* asset_manager = AAssetManager_fromJava(env, java_asset_manager);
 


Test patch:
diff --git a/tests/main_android/AndroidManifest.xml b/tests/main_android/AndroidManifest.xml
--- a/tests/main_android/AndroidManifest.xml
+++ b/tests/main_android/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.acl"
+      package="com.acl.unit_tests"
       android:versionCode="1"
       android:versionName="1.0">
     <uses-sdk android:minSdkVersion="3" />
diff --git a/tests/main_android/CMakeLists.txt b/tests/main_android/CMakeLists.txt
--- a/tests/main_android/CMakeLists.txt
+++ b/tests/main_android/CMakeLists.txt
@@ -36,7 +36,7 @@ file(GLOB_RECURSE ALL_MAIN_SOURCE_FILES LIST_DIRECTORIES false
 create_source_groups("${ALL_MAIN_SOURCE_FILES}" ${PROJECT_SOURCE_DIR})
 
 # Add resource files
-set(JAVA_FILES java/com/acl/MainActivity.java)
+set(JAVA_FILES java/com/acl/unit_tests/MainActivity.java)
 set(RESOURCE_FILES res/values/strings.xml)
 set(ANDROID_FILES AndroidManifest.xml)
 
diff --git a/tests/main_android/java/com/acl/MainActivity.java b/tests/main_android/java/com/acl/unit_tests/MainActivity.java
similarity index 96%
rename from tests/main_android/java/com/acl/MainActivity.java
rename to tests/main_android/java/com/acl/unit_tests/MainActivity.java
--- a/tests/main_android/java/com/acl/MainActivity.java
+++ b/tests/main_android/java/com/acl/unit_tests/MainActivity.java
@@ -1,4 +1,4 @@
-package com.acl;
+package com.acl.unit_tests;
 
 import android.app.Activity;
 import android.widget.TextView;
diff --git a/tests/main_android/jni/main.cpp b/tests/main_android/jni/main.cpp
--- a/tests/main_android/jni/main.cpp
+++ b/tests/main_android/jni/main.cpp
@@ -27,12 +27,12 @@
 
 #include <jni.h>
 
-extern "C" jint Java_com_acl_MainActivity_getNumUnitTestCases(JNIEnv* env, jobject caller)
+extern "C" jint Java_com_acl_unit_1tests_MainActivity_getNumUnitTestCases(JNIEnv* env, jobject caller)
 {
 	return Catch::getRegistryHub().getTestCaseRegistry().getAllTests().size();
 }
 
-extern "C" jint Java_com_acl_MainActivity_runUnitTests(JNIEnv* env, jobject caller)
+extern "C" jint Java_com_acl_unit_1tests_MainActivity_runUnitTests(JNIEnv* env, jobject caller)
 {
 	int result = Catch::Session().run();
 
diff --git a/tools/regression_tester_android/java/com/acl/MainActivity.java b/tools/regression_tester_android/java/com/acl/regression_tests/MainActivity.java
similarity index 95%
rename from tools/regression_tester_android/java/com/acl/MainActivity.java
rename to tools/regression_tester_android/java/com/acl/regression_tests/MainActivity.java
--- a/tools/regression_tester_android/java/com/acl/MainActivity.java
+++ b/tools/regression_tester_android/java/com/acl/regression_tests/MainActivity.java
@@ -1,4 +1,4 @@
-package com.acl;
+package com.acl.regression_tests;
 
 import android.app.Activity;
 import android.content.res.AssetManager;