Skip to content

Commit bde0a3d

Browse files
author
minggo
authored
don't copy not exist files when creating a new project (cocos2d#18618)
1 parent cf1049f commit bde0a3d

File tree

3 files changed

+18
-54
lines changed

3 files changed

+18
-54
lines changed

templates/cpp-template-default/cocos-project-template.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@
2323
"proj.win32/PROJECT_NAME.vcxproj.user",
2424
"proj.win32/PROJECT_NAME.sln",
2525
"proj.win32/main.cpp",
26-
"proj.android/.project",
27-
"proj.android/.cproject",
28-
"proj.android/AndroidManifest.xml",
29-
"proj.android/build.xml",
30-
"proj.android/res/values/strings.xml",
31-
"proj.android-studio/settings.gradle",
32-
"proj.android-studio/app/res/values/strings.xml",
26+
"proj.android/settings.gradle",
27+
"proj.android/app/res/values/strings.xml",
3328
"proj.ios_mac/ios/main.m",
3429
"proj.ios_mac/ios/Prefix.pch",
3530
"proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj",
@@ -39,9 +34,8 @@
3934
"project_replace_package_name":{
4035
"src_package_name":"org.cocos2dx.hellocpp",
4136
"files":[
42-
"proj.android/AndroidManifest.xml",
43-
"proj.android-studio/app/build.gradle",
44-
"proj.android-studio/app/AndroidManifest.xml"
37+
"proj.android/app/build.gradle",
38+
"proj.android/app/AndroidManifest.xml"
4539
]
4640
},
4741
"project_replace_mac_bundleid": {
@@ -74,13 +68,9 @@
7468
"pattern": "UIInterfaceOrientationLandscapeLeft",
7569
"replace_string": "UIInterfaceOrientationPortraitUpsideDown"
7670
},
71+
7772
{
78-
"file_path": "proj.android/AndroidManifest.xml",
79-
"pattern": "android:screenOrientation=\\\".*\\\"",
80-
"replace_string": "android:screenOrientation=\"portrait\""
81-
},
82-
{
83-
"file_path": "proj.android-studio/app/AndroidManifest.xml",
73+
"file_path": "proj.android/app/AndroidManifest.xml",
8474
"pattern": "android:screenOrientation=\\\".*\\\"",
8575
"replace_string": "android:screenOrientation=\"portrait\""
8676
}

templates/js-template-default/cocos-project-template.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@
4848
"frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user",
4949
"frameworks/runtime-src/proj.win32/PROJECT_NAME.sln",
5050
"frameworks/runtime-src/proj.win32/main.cpp",
51-
"frameworks/runtime-src/proj.android/.project",
52-
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
53-
"frameworks/runtime-src/proj.android/build.xml",
54-
"frameworks/runtime-src/proj.android/res/values/strings.xml",
55-
"frameworks/runtime-src/proj.android-studio/settings.gradle",
56-
"frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml",
51+
"frameworks/runtime-src/proj.android/settings.gradle",
52+
"frameworks/runtime-src/proj.android/app/res/values/strings.xml",
5753
"frameworks/runtime-src/proj.ios_mac/ios/main.m",
5854
"frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch",
5955
"frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj",
@@ -63,9 +59,8 @@
6359
"project_replace_package_name":{
6460
"src_package_name":"org.cocos2dx.hellojavascript",
6561
"files":[
66-
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
67-
"frameworks/runtime-src/proj.android-studio/app/build.gradle",
68-
"frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml"
62+
"frameworks/runtime-src/proj.android/app/build.gradle",
63+
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml"
6964
]
7065
},
7166
"project_replace_mac_bundleid":{
@@ -104,12 +99,7 @@
10499
"replace_string": "UIInterfaceOrientationPortraitUpsideDown"
105100
},
106101
{
107-
"file_path": "frameworks/runtime-src/proj.android/AndroidManifest.xml",
108-
"pattern": "android:screenOrientation=\\\".*\\\"",
109-
"replace_string": "android:screenOrientation=\"portrait\""
110-
},
111-
{
112-
"file_path": "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml",
102+
"file_path": "frameworks/runtime-src/proj.android/app/AndroidManifest.xml",
113103
"pattern": "android:screenOrientation=\\\".*\\\"",
114104
"replace_string": "android:screenOrientation=\"portrait\""
115105
}

templates/lua-template-default/cocos-project-template.json

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@
148148
"frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters",
149149
"frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user",
150150
"frameworks/runtime-src/proj.win32/PROJECT_NAME.sln",
151-
"frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj",
152-
"frameworks/runtime-src/proj.tizen/shared/res/PROJECT_NAME.png"
151+
"frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj"
153152
]
154153
},
155154
"project_replace_project_name": {
@@ -162,28 +161,18 @@
162161
"frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user",
163162
"frameworks/runtime-src/proj.win32/PROJECT_NAME.sln",
164163
"frameworks/runtime-src/proj.win32/main.cpp",
165-
"frameworks/runtime-src/proj.android/.project",
166-
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
167-
"frameworks/runtime-src/proj.android/build.xml",
168-
"frameworks/runtime-src/proj.android/res/values/strings.xml",
169-
"frameworks/runtime-src/proj.android-studio/settings.gradle",
170-
"frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml",
164+
"frameworks/runtime-src/proj.android/settings.gradle",
165+
"frameworks/runtime-src/proj.android/app/res/values/strings.xml",
171166
"frameworks/runtime-src/proj.ios_mac/ios/main.m",
172167
"frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch",
173168
"frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm",
174-
"frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj",
175-
"frameworks/runtime-src/proj.tizen/.project",
176-
"frameworks/runtime-src/proj.tizen/tizen-manifest.xml"
177-
]
169+
"frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj" ]
178170
},
179171
"project_replace_package_name": {
180172
"src_package_name": "org.cocos2dx.hellolua",
181173
"files": [
182-
"frameworks/runtime-src/proj.android/AndroidManifest.xml",
183-
"frameworks/runtime-src/proj.android-studio/app/build.gradle",
184-
"frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml",
185-
"frameworks/runtime-src/proj.tizen/tizen-manifest.xml"
186-
]
174+
"frameworks/runtime-src/proj.android/app/build.gradle",
175+
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml" ]
187176
},
188177
"project_replace_mac_bundleid": {
189178
"src_bundle_id": "org.cocos2dx.hellolua",
@@ -226,12 +215,7 @@
226215
"replace_string": "UIInterfaceOrientationPortraitUpsideDown"
227216
},
228217
{
229-
"file_path": "frameworks/runtime-src/proj.android/AndroidManifest.xml",
230-
"pattern": "android:screenOrientation=\\\".*\\\"",
231-
"replace_string": "android:screenOrientation=\"portrait\""
232-
},
233-
{
234-
"file_path": "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml",
218+
"file_path": "frameworks/runtime-src/proj.android/app/AndroidManifest.xml",
235219
"pattern": "android:screenOrientation=\\\".*\\\"",
236220
"replace_string": "android:screenOrientation=\"portrait\""
237221
}

0 commit comments

Comments
 (0)