From 4099865bab605e60c09de7813201a103ddd8ab6e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Thu, 20 Mar 2025 12:28:08 +1100 Subject: [PATCH] Android Template Fixes v0.97.0 --- commandLine/src/defines.h | 2 +- commandLine/src/projects/android.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index eb78ea5c..49aede68 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "96" +#define OFPROJECTGENERATOR_MINOR_VERSION "97" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/android.cpp b/commandLine/src/projects/android.cpp index 835f6475..dd901fb5 100644 --- a/commandLine/src/projects/android.cpp +++ b/commandLine/src/projects/android.cpp @@ -53,8 +53,8 @@ bool androidProject::createProjectFile(){ // Copy the `src/` folder from the template try { fs::copy( - templatePath / "ofApp" / "src", - projectDir / "ofApp" / "src", + templatePath / "ofApp", + projectDir / "ofApp", fs::copy_options::recursive | (bOverwrite ? fs::copy_options::overwrite_existing : fs::copy_options::update_existing) ); } catch (fs::filesystem_error & e) { @@ -63,7 +63,7 @@ bool androidProject::createProjectFile(){ } try { - fs::copy(templatePath / "res", projectDir / "ofApp/res", fs::copy_options::recursive); + fs::copy(templatePath / "ofApp/src/res", projectDir / "ofApp/src/res", fs::copy_options::recursive); } catch (fs::filesystem_error & e) { ofLogError(LOG_NAME) << "Error copying res folder: " << e.what(); } @@ -78,8 +78,8 @@ bool androidProject::createProjectFile(){ } findandreplaceInTexfile(projectDir / "ofApp/res/values/strings.xml", "TEMPLATE_APP_NAME", projectName); - fs::path from = projectDir / "srcJava/cc/openframeworks/APP_NAME"; - fs::path to = projectDir / ("srcJava/cc/openframeworks/" + projectName); + fs::path from = projectDir / "ofApp/src/java/cc/openframeworks/android"; + fs::path to = projectDir / ("ofApp/src/java/cc/openframeworks/android"); try { fs::create_directories(to.parent_path()); @@ -88,8 +88,6 @@ bool androidProject::createProjectFile(){ ofLogError(LOG_NAME) << "Error renaming package directory: " << e.what(); } - findandreplaceInTexfile(to / "OFActivity.java", "TEMPLATE_APP_NAME", projectName); - ofLogNotice(LOG_NAME) << "Android Project created successfully!"; return true; }