dfb 1.0.9 → 1.1.0
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/bin/dfb +8 -0
- data/lib/dfb.rb +45 -17
- data/lib/dfb/version.rb +1 -1
- 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: 65647d5a508cfd5a87b71e613fd251592ba3d7877ef458e59821525ca26407b9
|
4
|
+
data.tar.gz: f88be74eba4e6720be6b99f9830dde7fcbc6f8adf36bc312cd1fa1d014ea51a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c52fa0fed48acf050c6b05eb879819b699c68ffcec644295214274d18dcd215be891e4b356f7df74638fa764e886993098a3e6b3b451c504fde005aec853ecc8
|
7
|
+
data.tar.gz: 70a1249913d55c256680083e3b69cfe56ecf63c875054b831632cc1df35796ec43ce7c562cf8de640f800efeecb5163a73b6eb3aff0204b4d0c4d2b6af43c7a0
|
data/bin/dfb
CHANGED
@@ -47,6 +47,14 @@ class App
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
desc '修改当前工程指向的目录'
|
51
|
+
arg_name 'Describe arguments to complete here'
|
52
|
+
command :clone do |c|
|
53
|
+
c.action do |global_options,options,args|
|
54
|
+
Dfb.changePath
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
desc '下载词典flutter工程'
|
51
59
|
arg_name 'Describe arguments to complete here'
|
52
60
|
command :clone do |c|
|
data/lib/dfb.rb
CHANGED
@@ -28,36 +28,48 @@ module Dfb
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.init_flutter
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
puts "正在配置flutter环境"
|
32
|
+
outputs = File.dirname(__FILE__)
|
33
|
+
outputs = outputs.chop.chop.chop.chop #看到这行代码别骂作者,作者也不熟悉ruby,这个意思是说去除/lib
|
34
|
+
puts outputs
|
35
|
+
system "sh " + outputs + "/install_flutter_env.sh"
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.run_ios
|
39
|
-
|
39
|
+
#ideviceinstaller https://www.jianshu.com/p/92273e86ab2b
|
40
40
|
# system "pod install"
|
41
|
+
if self.isHasProject == false
|
42
|
+
return
|
43
|
+
end
|
41
44
|
p "还没有实现"
|
42
45
|
end
|
43
46
|
|
44
47
|
def self.run_android
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
#https://blog.csdn.net/tymatlab/article/details/80989769
|
49
|
+
if self.isHasProject == false
|
50
|
+
return
|
51
|
+
end
|
52
|
+
self.flutter_clean
|
53
|
+
self.pub_get
|
54
|
+
#打包
|
55
|
+
system self.cdPathWithAndroidExample + ";./gradlew assembleDebug;"
|
56
|
+
#装载,运行
|
57
|
+
system self.cdPathWithAndroidExample + "/app/build/outputs/apk/debug/;adb install -r app-debug.apk;adb shell am start -n com.example.android_example/.MainActivity;"
|
52
58
|
|
53
59
|
end
|
54
60
|
|
55
61
|
def self.attach
|
62
|
+
if self.isHasProject == false
|
63
|
+
return
|
64
|
+
end
|
56
65
|
puts "执行 flutter attach"
|
57
|
-
|
66
|
+
system self.cdPathWithFlutterModule + ";flutter attach;"
|
58
67
|
end
|
59
68
|
|
60
69
|
def self.create_package(packageName)
|
70
|
+
if self.isHasProject == false
|
71
|
+
return
|
72
|
+
end
|
61
73
|
self.checkEnv
|
62
74
|
puts "创建flutter package"
|
63
75
|
command = self.cdPathWithFlutterModule + "/Business;flutter create --template=package " + packageName
|
@@ -66,10 +78,16 @@ module Dfb
|
|
66
78
|
end
|
67
79
|
|
68
80
|
def self.pub_get
|
81
|
+
if self.isHasProject == false
|
82
|
+
return
|
83
|
+
end
|
69
84
|
system self.cdPathWithFlutterModule + ";sh flutter_pub_get.sh"
|
70
85
|
end
|
71
86
|
|
72
87
|
def self.flutter_clean
|
88
|
+
if self.isHasProject == false
|
89
|
+
return
|
90
|
+
end
|
73
91
|
system self.cdPathWithFlutterModule + ";flutter clean;"
|
74
92
|
end
|
75
93
|
|
@@ -89,7 +107,7 @@ module Dfb
|
|
89
107
|
end
|
90
108
|
|
91
109
|
def self.checkProject
|
92
|
-
outputs = system
|
110
|
+
outputs = system self.cdPathWithFlutterModule + ";"
|
93
111
|
if outputs == false
|
94
112
|
puts '工程已存在'
|
95
113
|
else
|
@@ -98,6 +116,16 @@ module Dfb
|
|
98
116
|
end
|
99
117
|
end
|
100
118
|
|
119
|
+
def self.isHasProject
|
120
|
+
outputs = system self.cdPathWithFlutterModule + ";"
|
121
|
+
if outputs == false
|
122
|
+
puts '工程不存在'
|
123
|
+
return false
|
124
|
+
else
|
125
|
+
return true
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
101
129
|
def self.changePath
|
102
130
|
puts "如果您的工程是YDNativeFlutterBridge 路径是 /Users/chedch/YDDictFlutter/YDNativeFlutterBridge,则输入此路径"
|
103
131
|
puts "请输入您的新的YDNativeFlutterBridge工程路径:"
|
@@ -137,10 +165,10 @@ module Dfb
|
|
137
165
|
|
138
166
|
# Dfb.changePath("/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf")
|
139
167
|
# Dfb.systemCDInProject
|
140
|
-
|
168
|
+
Dfb.attach
|
141
169
|
# Dfb.systemCDInProject
|
142
170
|
# Dfb.changePath
|
143
|
-
Dfb.run_android
|
171
|
+
# Dfb.run_android
|
144
172
|
# Dfb.cdPathWithFlutterModule
|
145
173
|
# Dfb.cdPathWithAndroidExample
|
146
174
|
|
data/lib/dfb/version.rb
CHANGED