update target file

This commit is contained in:
pengfei.zhou 2020-03-31 19:20:22 +08:00 committed by osborn
parent 20524eede4
commit feec2cf0ad
18 changed files with 21 additions and 27 deletions

View File

@ -92,7 +92,12 @@ function initAndroid(path, name) {
return console.error(err);
}
copyFolder(`${targetAndroidPath}`, `${path}`, () => {
['app/src/main/java/pub/doric/example/MainActivity.java', 'app/build.gradle'].forEach(e => {
[
'app/src/main/java/pub/doric/example/MainActivity.java',
'app/build.gradle',
'app/src/main/res/values/strings.xml',
'settings.gradle',
].forEach(e => {
fs.writeFileSync(`${path}/${e}`,
fs.readFileSync(`${targetAndroidPath}/${e}`).toString()
.replace(/__\$__/g, name)
@ -114,8 +119,12 @@ function initiOS(path, name) {
return console.error(err);
}
copyFolder(`${targetiOSPath}`, `${path}`, () => {
['Example/SceneDelegate.m', 'Example/AppDelegate.m', 'Podfile'].forEach(e => {
fs.writeFileSync(`${path}/${e}`,
[
'Example/SceneDelegate.m',
'Example/AppDelegate.m',
'Podfile',
].forEach(e => {
fs.writeFileSync(`${pathq}/${e}`,
fs.readFileSync(`${targetiOSPath}/${e}`).toString()
.replace(/__\$__/g, name)
.replace(/__\$Version__/g, currentVersion))

View File

@ -1,3 +1,3 @@
<resources>
<string name="app_name">Example</string>
<string name="app_name">__$__</string>
</resources>

View File

@ -1,2 +1,2 @@
include ':app'
rootProject.name='Example'
rootProject.name='__$__'

View File

@ -1,5 +1,5 @@
Podfile.lock
Example.xcworkspace/
*.xcworkspace/
Pods/
.idea/
Example.xcodeproj/xcuserdata/
*.xcodeproj/xcuserdata/

View File

@ -57,7 +57,7 @@
isa = PBXGroup;
children = (
E2B059BE23C452BB007555C7 /* src */,
E2F64CEC2399359C0006BD9A /* Example */,
E2F64CEC2399359C0006BD9A /* App */,
E2F64CEB2399359C0006BD9A /* Products */,
875E7B19E6A1ABA3F802B6B5 /* Pods */,
F654B22175F1FDDC9AE817FA /* Frameworks */,
@ -72,7 +72,7 @@
name = Products;
sourceTree = "<group>";
};
E2F64CEC2399359C0006BD9A /* Example */ = {
E2F64CEC2399359C0006BD9A /* App */ = {
isa = PBXGroup;
children = (
E2F64CED2399359C0006BD9A /* AppDelegate.h */,
@ -84,7 +84,7 @@
E2F64CFE2399359E0006BD9A /* Info.plist */,
E2F64CFF2399359E0006BD9A /* main.m */,
);
path = Example;
path = App;
sourceTree = "<group>";
};
F654B22175F1FDDC9AE817FA /* Frameworks */ = {

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Example.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -1,11 +1,11 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Example' do
target '__$__' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Example
# Pods for __$__
pod 'DoricCore', '~>__$Version__'
pod 'DoricDevkit', '~>__$Version__'
end