Skip to content

Commit bb6456e

Browse files
authored
v103 - android project fixes (#634)
1 parent 74afcd4 commit bb6456e

File tree

4 files changed

+33
-36
lines changed

4 files changed

+33
-36
lines changed

commandLine/src/defines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
2-
#define OFPROJECTGENERATOR_MINOR_VERSION "102"
2+
#define OFPROJECTGENERATOR_MINOR_VERSION "103"
33
#define OFPROJECTGENERATOR_PATCH_VERSION "0"
44

55
#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)

commandLine/src/projects/android.cpp

+20-8
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,40 @@ androidProject::androidProject(const std::string & target) : baseProject(target)
1010

1111
bool androidProject::createProjectFile(){
1212

13+
bOverwrite = false;
1314
for (auto & f : vector<fs::path> {
1415
"build.gradle",
1516
"gradle",
16-
"gradle.properties",
17-
"local.properties",
1817
"ofApp/gradle.properties",
1918
"ofApp/proguard-rules.pro",
2019
"ofApp/src/AndroidManifest.xml",
2120
"ofApp/src/ic_launcher-playstore.png",
22-
"ofApp/src/CMakeLists.txt",
23-
"ofApp/src/main/main.txt",
24-
"ofApp/build.gradle",
25-
"src/ofApp.h",
26-
"src/ofApp.cpp",
27-
"src/main.cpp",
2821
"proguard.cfg",
2922
"settings.gradle",
3023
"template.config",
24+
"src/main.cpp",
3125
}) {
3226
copyTemplateFiles.push_back({
3327
templatePath / f,
3428
projectDir / f
3529
});
3630
}
31+
for (auto & f : vector<fs::path> {
32+
"src/ofApp.h",
33+
"src/ofApp.cpp",
34+
"ofApp/src/CMakeLists.txt",
35+
"ofApp/src/java/cc/openframeworks/android/OFActivity.java",
36+
"local.properties",
37+
"gradle.properties",
38+
"ofApp/build.gradle",
39+
}) {
40+
if (!fs::exists(projectDir / f)) {
41+
copyTemplateFiles.push_back({
42+
templatePath / f,
43+
projectDir / f
44+
});
45+
}
46+
}
3747
copyTemplateFiles.push_back({
3848
templatePath / "ofApp" / "build.gradle",
3949
projectDir / "ofApp" / "build.gradle",
@@ -61,6 +71,8 @@ bool androidProject::createProjectFile(){
6171
ofLogError(LOG_NAME) << "Copy failed: " << e.what();
6272
return false;
6373
}
74+
75+
6476

6577
try {
6678
fs::copy(templatePath / "ofApp/src/res", projectDir / "ofApp/src/res", fs::copy_options::recursive);

commandLine/src/projects/xcodeProject.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,6 @@ bool xcodeProject::createProjectFile() {
155155
if (fs::exists(templateDataDir) && fs::is_directory(templateDataDir)) {
156156
baseProject::recursiveCopyContents(templateDataDir, projectDataDir);
157157
}
158-
if (fs::exists(templateBinDir) && fs::is_directory(templateBinDir)) {
159-
#ifdef TARGET_OS_MAC
160-
try {
161-
// extended attributes on macOS
162-
std::string command = "xattr -w com.apple.xcode.CreatedByBuildSystem true " + templateBinDir.string();
163-
if (std::system(command.c_str()) != 0) {
164-
std::cerr << "Failed to set extended attributes on " << templateBinDir.string() << std::endl;
165-
} else {
166-
ofLogVerbose("xcodeProject") << "xattr set correctly for /bin" << endl;
167-
}
168-
} catch (const std::exception & e) {
169-
std::cout << "xcodeProject::createProjectFile() error " << e.what() << std::endl;
170-
}
171-
#endif
172-
}
173158
}
174159
return true;
175160
}

frontend/npm-shrinkwrap.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)