vsvipergen 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/console +35 -26
- data/exe/vsvipergen +35 -26
- data/lib/templates/view/VS<$$>Page.java +1 -10
- data/lib/vsvipergen/version.rb +1 -1
- data/lib/vsvipergen.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fff1cfa9dd3b781bf9df172b90e9d7e7722e6d2f6d0dcd7328986b184e2dc58
|
4
|
+
data.tar.gz: 83fbf4777209b907ab122e1cb56ba71fc6faf4d369b2d446f4adfedf66920b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a237922605acda4d2f8db8b468349fed8af1f08f4e7e42db928de454a21eaa192df67684155ac7f437a41b828141d9efa185385685dd9b9bc0153a4c1bb53db
|
7
|
+
data.tar.gz: 0f6b3a76520d322ae2d9f13abe9329feeb13e9a88015dd4d7922866e2368605238b64d62a22145e6d8d8801f82f9320cc0a34fc16f53f37836aab4327e2ec9ba
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
@@ -19,6 +19,7 @@ modelPrefix = ""
|
|
19
19
|
now = Time.now.strftime("%Y/%m/%d")
|
20
20
|
year = Time.now.strftime("%Y")
|
21
21
|
|
22
|
+
# 프로그래밍 언어 입력 요구
|
22
23
|
while true
|
23
24
|
puts "input language [o:objc, a:android] : "
|
24
25
|
lang = gets
|
@@ -26,6 +27,7 @@ while true
|
|
26
27
|
break if (lang.strip == "objc" || lang.strip == "o" || lang.strip == "android" || lang.strip == "a")
|
27
28
|
end
|
28
29
|
|
30
|
+
# objective-c 선택일 경우 프로젝트 파일 이름 입력 요구
|
29
31
|
if lang.strip == "objc" || lang.strip == "o" then
|
30
32
|
puts "input project file name [ex:VLunch] :"
|
31
33
|
while true
|
@@ -35,18 +37,22 @@ if lang.strip == "objc" || lang.strip == "o" then
|
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
38
|
-
|
40
|
+
# 파일 prefix 입력 요구
|
41
|
+
puts "input file prefix [ex:type Login for VSLoginViewController(or VSLoginPage), ...] : "
|
39
42
|
filePrefix = gets
|
40
43
|
|
41
44
|
if filePrefix == "" then
|
42
45
|
filePrefix = "Default"
|
43
46
|
end
|
44
47
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
# objective-c 선택일 경우 모델 prefix 입력 요구
|
49
|
+
if lang.strip == "objc" || lang.strip == "o" then
|
50
|
+
puts "input model prefix [ex:type User for VSUserVO] : "
|
51
|
+
modelPrefix = gets
|
52
|
+
|
53
|
+
if modelPrefix == "" then
|
54
|
+
modelPrefix = "Default"
|
55
|
+
end
|
50
56
|
end
|
51
57
|
|
52
58
|
############# handle user input end #############
|
@@ -85,24 +91,27 @@ end
|
|
85
91
|
################## make file ###################
|
86
92
|
#################################################
|
87
93
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
94
|
+
if lang.strip == "objc" || lang.strip == "o" then
|
95
|
+
#################################################
|
96
|
+
############# add file to project ##############
|
97
|
+
# Open the existing Xcode project
|
98
|
+
xcodeProjectFile = projectName.strip + ".xcodeproj".strip
|
99
|
+
project = Xcodeproj::Project.open(xcodeProjectFile.strip)
|
100
|
+
targets = project.targets
|
101
|
+
mainTarget = project.targets.first
|
102
|
+
newGroup = project.new_group(filePrefix.strip)
|
103
|
+
|
104
|
+
# Add a file to the project in the main group
|
105
|
+
for filePath in generatedFilePaths
|
106
|
+
file = newGroup.new_file(filePath.strip)
|
107
|
+
|
108
|
+
# Add the file to the main target
|
109
|
+
mainTarget.add_file_references([file])
|
110
|
+
end
|
104
111
|
|
105
|
-
# Save the project file
|
106
|
-
project.save(xcodeProjectFile)
|
107
|
-
|
108
|
-
|
112
|
+
# Save the project file
|
113
|
+
project.save(xcodeProjectFile)
|
114
|
+
puts "all files added to xcode project."
|
115
|
+
############# add file to project ##############
|
116
|
+
#################################################
|
117
|
+
end
|
data/exe/vsvipergen
CHANGED
@@ -18,6 +18,7 @@ modelPrefix = ""
|
|
18
18
|
now = Time.now.strftime("%Y/%m/%d")
|
19
19
|
year = Time.now.strftime("%Y")
|
20
20
|
|
21
|
+
# 프로그래밍 언어 입력 요구
|
21
22
|
while true
|
22
23
|
puts "input language [o:objc, a:android] : "
|
23
24
|
lang = gets
|
@@ -25,6 +26,7 @@ while true
|
|
25
26
|
break if (lang.strip == "objc" || lang.strip == "o" || lang.strip == "android" || lang.strip == "a")
|
26
27
|
end
|
27
28
|
|
29
|
+
# objective-c 선택일 경우 프로젝트 파일 이름 입력 요구
|
28
30
|
if lang.strip == "objc" || lang.strip == "o" then
|
29
31
|
puts "input project file name [ex:VLunch] :"
|
30
32
|
while true
|
@@ -34,18 +36,22 @@ if lang.strip == "objc" || lang.strip == "o" then
|
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
37
|
-
|
39
|
+
# 파일 prefix 입력 요구
|
40
|
+
puts "input file prefix [ex:type Login for VSLoginViewController(or VSLoginPage), ...] : "
|
38
41
|
filePrefix = gets
|
39
42
|
|
40
43
|
if filePrefix == "" then
|
41
44
|
filePrefix = "Default"
|
42
45
|
end
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
# objective-c 선택일 경우 모델 prefix 입력 요구
|
48
|
+
if lang.strip == "objc" || lang.strip == "o" then
|
49
|
+
puts "input model prefix [ex:type User for VSUserVO] : "
|
50
|
+
modelPrefix = gets
|
51
|
+
|
52
|
+
if modelPrefix == "" then
|
53
|
+
modelPrefix = "Default"
|
54
|
+
end
|
49
55
|
end
|
50
56
|
|
51
57
|
############# handle user input end #############
|
@@ -84,24 +90,27 @@ end
|
|
84
90
|
################## make file ###################
|
85
91
|
#################################################
|
86
92
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
93
|
+
if lang.strip == "objc" || lang.strip == "o" then
|
94
|
+
#################################################
|
95
|
+
############# add file to project ##############
|
96
|
+
# Open the existing Xcode project
|
97
|
+
xcodeProjectFile = projectName.strip + ".xcodeproj".strip
|
98
|
+
project = Xcodeproj::Project.open(xcodeProjectFile.strip)
|
99
|
+
targets = project.targets
|
100
|
+
mainTarget = project.targets.first
|
101
|
+
newGroup = project.new_group(filePrefix.strip)
|
102
|
+
|
103
|
+
# Add a file to the project in the main group
|
104
|
+
for filePath in generatedFilePaths
|
105
|
+
file = newGroup.new_file(filePath.strip)
|
106
|
+
|
107
|
+
# Add the file to the main target
|
108
|
+
mainTarget.add_file_references([file])
|
109
|
+
end
|
103
110
|
|
104
|
-
# Save the project file
|
105
|
-
project.save(xcodeProjectFile)
|
106
|
-
|
107
|
-
|
111
|
+
# Save the project file
|
112
|
+
project.save(xcodeProjectFile)
|
113
|
+
puts "all files added to xcode project."
|
114
|
+
############# add file to project ##############
|
115
|
+
#################################################
|
116
|
+
end
|
@@ -2,20 +2,11 @@
|
|
2
2
|
* Created by Vendys on <$now$>..
|
3
3
|
*/
|
4
4
|
|
5
|
-
public class VS<$prefix$>Page
|
5
|
+
public class VS<$prefix$>Page implements VS<$prefix$>Constracts.I<$prefix$>ViewForPresenter {
|
6
6
|
|
7
7
|
public VS<$prefix$>Constracts.I<$prefix$>PresenterForView presenter;
|
8
8
|
|
9
9
|
public VS<$prefix$>Page(Context ac) {
|
10
10
|
}
|
11
11
|
|
12
|
-
@Override
|
13
|
-
public void onResumePage() {
|
14
|
-
}
|
15
|
-
|
16
|
-
@Override
|
17
|
-
public void onFlipAfter() {
|
18
|
-
super.onFlipAfter();
|
19
|
-
this.presenter.initialize();
|
20
|
-
}
|
21
12
|
}
|
data/lib/vsvipergen/version.rb
CHANGED
data/lib/vsvipergen.rb
CHANGED
@@ -94,9 +94,10 @@ module Vsvipergen
|
|
94
94
|
|
95
95
|
def createAndroidGenerator
|
96
96
|
# generating model files
|
97
|
-
|
98
|
-
javaModelFileGenerator
|
99
|
-
|
97
|
+
# 모델 생성은 하지 않는 최성식 팀장님의 요구 사항 적용
|
98
|
+
# javaModelFileGenerator = Vsvipergen::ViperAndroidModelFileGenerator.new
|
99
|
+
# javaModelFileGenerator.init(filePrefix, now, year, modelPrefix)
|
100
|
+
# fileGenerators.push(javaModelFileGenerator)
|
100
101
|
|
101
102
|
# generating contracts file
|
102
103
|
androidContractFileGenerator = Vsvipergen::ViperAndroidContractsFileGenerator.new
|