ykioscmd 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.YKPodSpecConfig.yml +5 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +4 -0
- data/.idea/ruby-client.iml +38 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +8388 -0
- data/.idea/yk_command.iml +105 -0
- data/.ruby-version +1 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +153 -0
- data/README.html +109 -0
- data/README.md +104 -0
- data/Rakefile +4 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/bin/ykioscmd +7 -0
- data/configruation-files/.YKBotConfig.yml +4 -0
- data/configruation-files/.YKGitlabConfig.yml +3 -0
- data/configruation-files/.YKProjectConfig.yml +4 -0
- data/configruation-files/.YKServerConfig.yml +3 -0
- data/debugProject/.DS_Store +0 -0
- data/images/Xnip2022-04-26_17-25-30.jpg +0 -0
- data/images/Xnip2022-04-26_17-27-32.jpg +0 -0
- data/images/Xnip2022-04-26_17-30-36.jpg +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/yk_command/.DS_Store +0 -0
- data/lib/yk_command/analyze/analyze.rb +177 -0
- data/lib/yk_command/analyze/dependency_result.rb +138 -0
- data/lib/yk_command/analyze/request.rb +41 -0
- data/lib/yk_command/bot/wx_bot.rb +66 -0
- data/lib/yk_command/commands.rb +108 -0
- data/lib/yk_command/component_manage/component_manage_platform.rb +101 -0
- data/lib/yk_command/config/yk_config.rb +30 -0
- data/lib/yk_command/evaluate/evaluate.rb +7 -0
- data/lib/yk_command/gitlab/yk_gitlab.rb +77 -0
- data/lib/yk_command/module/.DS_Store +0 -0
- data/lib/yk_command/module/module_handler.rb +93 -0
- data/lib/yk_command/module/template/.DS_Store +0 -0
- data/lib/yk_command/module/template/objc/.DS_Store +0 -0
- data/lib/yk_command/module/template/objc/BusinessHeader.h +0 -0
- data/lib/yk_command/module/template/objc/CategoryHeader.h +12 -0
- data/lib/yk_command/module/template/objc/Helper.h +16 -0
- data/lib/yk_command/module/template/objc/Helper.m +41 -0
- data/lib/yk_command/module/template/objc/PrefixHeader.pch +30 -0
- data/lib/yk_command/module/template/objc/RouterRegister.h +16 -0
- data/lib/yk_command/module/template/objc/RouterRegister.m +26 -0
- data/lib/yk_command/module/template/objc/ServiceRegister.h +16 -0
- data/lib/yk_command/module/template/objc/ServiceRegister.m +21 -0
- data/lib/yk_command/module/template/objc/ToolsHeader.h +13 -0
- data/lib/yk_command/module/template/objc/VendorHeader.h +13 -0
- data/lib/yk_command/module/template/swift/.DS_Store +0 -0
- data/lib/yk_command/module/template/swift/PrefixHeader_swift.swift +10 -0
- data/lib/yk_command/module/template/swift/RouterRegisterSwift.swift +23 -0
- data/lib/yk_command/module/template/swift/ServiceRegisterSwift.swift +20 -0
- data/lib/yk_command/module/template/swift/Tool.swift +53 -0
- data/lib/yk_command/module/yk_module.rb +215 -0
- data/lib/yk_command/project/.DS_Store +0 -0
- data/lib/yk_command/project/full_component_demo_template/.gitignore +37 -0
- data/lib/yk_command/project/full_component_demo_template/.travis.yml +14 -0
- data/lib/yk_command/project/full_component_demo_template/CODE_OF_CONDUCT.md +40 -0
- data/lib/yk_command/project/full_component_demo_template/LICENSE +21 -0
- data/lib/yk_command/project/full_component_demo_template/NAME-osx.podspec +43 -0
- data/lib/yk_command/project/full_component_demo_template/NAME.podspec +151 -0
- data/lib/yk_command/project/full_component_demo_template/POD_LICENSE +19 -0
- data/lib/yk_command/project/full_component_demo_template/POD_README.md +29 -0
- data/lib/yk_command/project/full_component_demo_template/Pod/Assets/.gitkeep +0 -0
- data/lib/yk_command/project/full_component_demo_template/Pod/Classes/.gitkeep +0 -0
- data/lib/yk_command/project/full_component_demo_template/README.md +22 -0
- data/lib/yk_command/project/full_component_demo_template/configure +12 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/Base.lproj/LaunchScreen.storyboard +31 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/Base.lproj/Main.storyboard +79 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/CPDAppDelegate.h +15 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/CPDAppDelegate.m +46 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/CPDViewController.h +13 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/CPDViewController.m +47 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +98 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/PROJECT-Info.plist +49 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/PROJECT-Prefix.pch +16 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/main.m +17 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.pbxproj +500 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +101 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Podfile +34 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Tests/Tests-Info.plist +22 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Tests/Tests-Prefix.pch +7 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Tests/Tests.m +9 -0
- data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Tests/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/AppDelegate.swift +26 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/Base.lproj/Main.storyboard +717 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/Info.plist +30 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/PROJECT.entitlements +10 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT/ViewController.swift +27 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.pbxproj +444 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +103 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/Podfile +11 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/Tests/Info.plist +22 -0
- data/lib/yk_command/project/full_component_demo_template/templates/macos-swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/AppDelegate.swift +46 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Base.lproj/LaunchScreen.xib +46 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Base.lproj/Main.storyboard +86 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Example-Bridging-Header.h +4 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Info.plist +39 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/STTestAppDelegate.swift +16 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Tests-Bridging-Header.h +4 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/ViewController.swift +51 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/YKEmptyOcFile.m +9 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.pbxproj +489 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +117 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/Podfile +35 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/Tests/Info.plist +24 -0
- data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/setup/ConfigureMacOSSwift.rb +46 -0
- data/lib/yk_command/project/setup/ConfigureSwift.rb +42 -0
- data/lib/yk_command/project/setup/ConfigureiOS.rb +106 -0
- data/lib/yk_command/project/setup/MessageBank.rb +113 -0
- data/lib/yk_command/project/setup/ProjectManipulator.rb +141 -0
- data/lib/yk_command/project/setup/TemplateConfigurator.rb +258 -0
- data/lib/yk_command/project/simple_component_demo_template/.gitignore +37 -0
- data/lib/yk_command/project/simple_component_demo_template/.travis.yml +14 -0
- data/lib/yk_command/project/simple_component_demo_template/CODE_OF_CONDUCT.md +40 -0
- data/lib/yk_command/project/simple_component_demo_template/LICENSE +21 -0
- data/lib/yk_command/project/simple_component_demo_template/NAME-osx.podspec +43 -0
- data/lib/yk_command/project/simple_component_demo_template/NAME.podspec +140 -0
- data/lib/yk_command/project/simple_component_demo_template/POD_LICENSE +19 -0
- data/lib/yk_command/project/simple_component_demo_template/POD_README.md +29 -0
- data/lib/yk_command/project/simple_component_demo_template/Pod/Assets/.gitkeep +0 -0
- data/lib/yk_command/project/simple_component_demo_template/Pod/Classes/.gitkeep +0 -0
- data/lib/yk_command/project/simple_component_demo_template/README.md +22 -0
- data/lib/yk_command/project/simple_component_demo_template/configure +13 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/Base.lproj/LaunchScreen.storyboard +31 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/Base.lproj/Main.storyboard +79 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/CPDAppDelegate.h +15 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/CPDAppDelegate.m +46 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/CPDViewController.h +13 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/CPDViewController.m +37 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +98 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/PROJECT-Info.plist +49 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/PROJECT-Prefix.pch +16 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT/main.m +17 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.pbxproj +500 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +101 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/Podfile +19 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/Tests/Tests-Info.plist +22 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/Tests/Tests-Prefix.pch +7 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/Tests/Tests.m +9 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/Tests/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/AppDelegate.swift +26 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/Base.lproj/Main.storyboard +717 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/Info.plist +30 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/PROJECT.entitlements +10 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT/ViewController.swift +27 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.pbxproj +444 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +103 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/Podfile +11 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/Tests/Info.plist +22 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/macos-swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/AppDelegate.swift +46 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/Base.lproj/LaunchScreen.xib +46 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/Base.lproj/Main.storyboard +103 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/EmptyOcFile.m +9 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/Info.plist +39 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/PROJECT_Example-Bridging-Header.h +4 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/PROJECT_Tests-Bridging-Header.h +4 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/ViewController.swift +32 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.pbxproj +489 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +117 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/Podfile +20 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/Tests/Info.plist +24 -0
- data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/test_examples/kiwi.m +36 -0
- data/lib/yk_command/project/test_examples/quick.swift +50 -0
- data/lib/yk_command/project/test_examples/specta.m +39 -0
- data/lib/yk_command/project/test_examples/xctest.m +26 -0
- data/lib/yk_command/project/test_examples/xctest.swift +28 -0
- data/lib/yk_command/project/yk_project.rb +92 -0
- data/lib/yk_command/repo_publish/component_default.yml +5 -0
- data/lib/yk_command/repo_publish/component_publish.rb +218 -0
- data/lib/yk_command/version.rb +5 -0
- data/lib/ykioscmd.rb +9 -0
- data/ykioscmd.gemspec +53 -0
- metadata +453 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
// https://github.com/kiwi-bdd/Kiwi
|
2
|
+
|
3
|
+
SPEC_BEGIN(InitialTests)
|
4
|
+
|
5
|
+
describe(@"My initial tests", ^{
|
6
|
+
|
7
|
+
context(@"will fail", ^{
|
8
|
+
|
9
|
+
it(@"can do maths", ^{
|
10
|
+
[[@1 should] equal:@2];
|
11
|
+
});
|
12
|
+
|
13
|
+
it(@"can read", ^{
|
14
|
+
[[@"number" should] equal:@"string"];
|
15
|
+
});
|
16
|
+
|
17
|
+
it(@"will wait and fail", ^{
|
18
|
+
NSObject *object = [[NSObject alloc] init];
|
19
|
+
[[expectFutureValue(object) shouldEventually] receive:@selector(autoContentAccessingProxy)];
|
20
|
+
});
|
21
|
+
});
|
22
|
+
|
23
|
+
context(@"will pass", ^{
|
24
|
+
|
25
|
+
it(@"can do maths", ^{
|
26
|
+
[[@1 should] beLessThan:@23];
|
27
|
+
});
|
28
|
+
|
29
|
+
it(@"can read", ^{
|
30
|
+
[[@"team" shouldNot] containString:@"I"];
|
31
|
+
});
|
32
|
+
});
|
33
|
+
|
34
|
+
});
|
35
|
+
|
36
|
+
SPEC_END
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// https://github.com/Quick/Quick
|
2
|
+
|
3
|
+
import Quick
|
4
|
+
import Nimble
|
5
|
+
import PROJECT
|
6
|
+
|
7
|
+
class TableOfContentsSpec: QuickSpec {
|
8
|
+
override func spec() {
|
9
|
+
describe("these will fail") {
|
10
|
+
|
11
|
+
it("can do maths") {
|
12
|
+
expect(1) == 2
|
13
|
+
}
|
14
|
+
|
15
|
+
it("can read") {
|
16
|
+
expect("number") == "string"
|
17
|
+
}
|
18
|
+
|
19
|
+
it("will eventually fail") {
|
20
|
+
expect("time").toEventually( equal("done") )
|
21
|
+
}
|
22
|
+
|
23
|
+
context("these will pass") {
|
24
|
+
|
25
|
+
it("can do maths") {
|
26
|
+
expect(23) == 23
|
27
|
+
}
|
28
|
+
|
29
|
+
it("can read") {
|
30
|
+
expect("🐮") == "🐮"
|
31
|
+
}
|
32
|
+
|
33
|
+
it("will eventually pass") {
|
34
|
+
var time = "passing"
|
35
|
+
|
36
|
+
DispatchQueue.main.async {
|
37
|
+
time = "done"
|
38
|
+
}
|
39
|
+
|
40
|
+
waitUntil { done in
|
41
|
+
Thread.sleep(forTimeInterval: 0.5)
|
42
|
+
expect(time) == "done"
|
43
|
+
|
44
|
+
done()
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// https://github.com/Specta/Specta
|
2
|
+
|
3
|
+
SpecBegin(InitialSpecs)
|
4
|
+
|
5
|
+
describe(@"these will fail", ^{
|
6
|
+
|
7
|
+
it(@"can do maths", ^{
|
8
|
+
expect(1).to.equal(2);
|
9
|
+
});
|
10
|
+
|
11
|
+
it(@"can read", ^{
|
12
|
+
expect(@"number").to.equal(@"string");
|
13
|
+
});
|
14
|
+
|
15
|
+
it(@"will wait for 10 seconds and fail", ^{
|
16
|
+
waitUntil(^(DoneCallback done) {
|
17
|
+
|
18
|
+
});
|
19
|
+
});
|
20
|
+
});
|
21
|
+
|
22
|
+
describe(@"these will pass", ^{
|
23
|
+
|
24
|
+
it(@"can do maths", ^{
|
25
|
+
expect(1).beLessThan(23);
|
26
|
+
});
|
27
|
+
|
28
|
+
it(@"can read", ^{
|
29
|
+
expect(@"team").toNot.contain(@"I");
|
30
|
+
});
|
31
|
+
|
32
|
+
it(@"will wait and succeed", ^{
|
33
|
+
waitUntil(^(DoneCallback done) {
|
34
|
+
done();
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
SpecEnd
|
@@ -0,0 +1,26 @@
|
|
1
|
+
@import XCTest;
|
2
|
+
|
3
|
+
@interface Tests : XCTestCase
|
4
|
+
|
5
|
+
@end
|
6
|
+
|
7
|
+
@implementation Tests
|
8
|
+
|
9
|
+
- (void)setUp
|
10
|
+
{
|
11
|
+
[super setUp];
|
12
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
13
|
+
}
|
14
|
+
|
15
|
+
- (void)tearDown
|
16
|
+
{
|
17
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
18
|
+
[super tearDown];
|
19
|
+
}
|
20
|
+
|
21
|
+
- (void)testExample
|
22
|
+
{
|
23
|
+
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
|
24
|
+
}
|
25
|
+
|
26
|
+
@end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import XCTest
|
2
|
+
import PROJECT
|
3
|
+
|
4
|
+
class Tests: XCTestCase {
|
5
|
+
|
6
|
+
override func setUp() {
|
7
|
+
super.setUp()
|
8
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
9
|
+
}
|
10
|
+
|
11
|
+
override func tearDown() {
|
12
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
13
|
+
super.tearDown()
|
14
|
+
}
|
15
|
+
|
16
|
+
func testExample() {
|
17
|
+
// This is an example of a functional test case.
|
18
|
+
XCTAssert(true, "Pass")
|
19
|
+
}
|
20
|
+
|
21
|
+
func testPerformanceExample() {
|
22
|
+
// This is an example of a performance test case.
|
23
|
+
self.measure() {
|
24
|
+
// Put the code you want to measure the time of here.
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require "colored"
|
2
|
+
require "fileutils"
|
3
|
+
require "psych"
|
4
|
+
require "thor/actions"
|
5
|
+
require_relative "setup/TemplateConfigurator"
|
6
|
+
require "yk_command/config/yk_config"
|
7
|
+
|
8
|
+
require "pathname"
|
9
|
+
|
10
|
+
module YkIosCmd
|
11
|
+
PROJECT_CONFIG_FILE = ".YKProjectConfig.yml".freeze
|
12
|
+
|
13
|
+
class YkProject < Thor
|
14
|
+
include Thor::Actions
|
15
|
+
|
16
|
+
no_commands do
|
17
|
+
def initialize(is_simple)
|
18
|
+
@is_simple = is_simple
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_host(app_name, framework, prefix, author, at_path)
|
22
|
+
prepare_project(app_name, framework, prefix, author, at_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def prepare_project(pod_name, framework, prefix, author, at_path)
|
26
|
+
des_path = Pathname.new(at_path)
|
27
|
+
current_class_path =
|
28
|
+
Pathname.new(File.dirname(File.expand_path __FILE__))
|
29
|
+
|
30
|
+
FileUtils.remove_dir("#{current_class_path.to_s + "/temp"}", true)
|
31
|
+
temp_foler = "full_component_demo_template"
|
32
|
+
temp_foler = "simple_component_demo_template" if @is_simple == true
|
33
|
+
FileUtils.copy_entry "#{current_class_path.to_s + "/#{temp_foler}"}",
|
34
|
+
"#{current_class_path.to_s + "/temp"}"
|
35
|
+
if @is_simple != true
|
36
|
+
prepare_template(
|
37
|
+
YkConfig.new(at_path).read_config PROJECT_CONFIG_FILE
|
38
|
+
)
|
39
|
+
end
|
40
|
+
Pod::TemplateConfigurator.new(
|
41
|
+
pod_name,
|
42
|
+
framework,
|
43
|
+
prefix,
|
44
|
+
author,
|
45
|
+
"#{current_class_path.to_s + "/temp"}",
|
46
|
+
@is_simple
|
47
|
+
).run
|
48
|
+
#move temp folder to destination
|
49
|
+
FileUtils.copy_entry "#{current_class_path.to_s + "/temp"}",
|
50
|
+
"#{des_path.to_s + "/#{pod_name}"}"
|
51
|
+
#删除临时目录
|
52
|
+
FileUtils.remove_dir("#{current_class_path.to_s + "/temp"}", true)
|
53
|
+
end
|
54
|
+
|
55
|
+
def prepare_template(config)
|
56
|
+
current_class_path =
|
57
|
+
Pathname.new(File.dirname(File.expand_path __FILE__))
|
58
|
+
temlates = %w[ios swift macos-swift]
|
59
|
+
|
60
|
+
temlates.each do |folder|
|
61
|
+
podfile =
|
62
|
+
"#{current_class_path.to_s + "/temp/templates/" + folder + "/Example/Podfile"}"
|
63
|
+
|
64
|
+
config["source"].each { |source| file_prepend podfile, source + "\n" }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def file_prepend(file, str)
|
69
|
+
new_contents = ""
|
70
|
+
File.open(file, "r") do |fd|
|
71
|
+
contents = fd.read
|
72
|
+
new_contents = str << contents
|
73
|
+
end
|
74
|
+
# Overwrite file but now with prepended string on it
|
75
|
+
File.open(file, "w") { |fd| fd.write(new_contents) }
|
76
|
+
end
|
77
|
+
|
78
|
+
# def read_config(at_path)
|
79
|
+
# hostA = 'yeah'
|
80
|
+
# hostB = 'ka'
|
81
|
+
# config_repo_url = "http://gitlab.#{hostA}#{hostB}.com/App/iOS/YKComponents/com-manage-platform-resources/configruation-files.git"
|
82
|
+
# system("git clone #{config_repo_url} #{at_path+'/configruation-files'}")
|
83
|
+
#
|
84
|
+
# config_file_path = "#{at_path}/#{PROJECT_CONFIG_FILE}"
|
85
|
+
# FileUtils.copy_file "#{at_path+'/configruation-files/'+PROJECT_CONFIG_FILE}", config_file_path
|
86
|
+
# FileUtils.remove_dir("#{at_path+'/configruation-files'}", true)
|
87
|
+
#
|
88
|
+
# File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
89
|
+
# end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,218 @@
|
|
1
|
+
require 'colored'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'yaml'
|
4
|
+
require 'thor'
|
5
|
+
require 'cocoapods-core/specification'
|
6
|
+
require 'git'
|
7
|
+
require 'yk_command/component_manage/component_manage_platform'
|
8
|
+
|
9
|
+
module YkIosCmd
|
10
|
+
PODSPEC_CONFIG_FILE = '.YKPodSpecConfig.yml'.freeze
|
11
|
+
|
12
|
+
class ComponentPublish < Thor
|
13
|
+
include Thor::Actions
|
14
|
+
no_commands do
|
15
|
+
def initialize(args = [], options = {}, config = {})
|
16
|
+
super
|
17
|
+
@component_name = ''
|
18
|
+
@version = ''
|
19
|
+
@description = ''
|
20
|
+
@deprecated_versions = ''
|
21
|
+
@env = 'pro'
|
22
|
+
end
|
23
|
+
|
24
|
+
def find_podspec_file(folder_path)
|
25
|
+
files = Dir.glob("#{folder_path}/*.podspec")
|
26
|
+
files[0]
|
27
|
+
end
|
28
|
+
|
29
|
+
def publish_component(path = nil)
|
30
|
+
path = Dir.pwd if path.nil?
|
31
|
+
# spec_file_path = "#{path}/lib/ykioscmd/repo_publish/iOSPipelineDemo.podspec"
|
32
|
+
|
33
|
+
spec_file_path = find_podspec_file path
|
34
|
+
|
35
|
+
@specification = Pod::Specification.from_file(spec_file_path)
|
36
|
+
@component_name = @specification.name
|
37
|
+
|
38
|
+
config_file_path = config_file(path)
|
39
|
+
config = YAML.load_file(config_file_path, {})
|
40
|
+
config['component_name'] = @component_name
|
41
|
+
say '-----------------------------------------------', :green
|
42
|
+
# 检查组件描述
|
43
|
+
if @specification.description.include? 'TODO' or
|
44
|
+
@specification.description.gsub(' ', '').length == 0
|
45
|
+
say '组件的描述字段不合格,请在podspec文件中填写适当的组件描述', :red
|
46
|
+
exit
|
47
|
+
else
|
48
|
+
config['description'] = @specification.description
|
49
|
+
end
|
50
|
+
# 读取发布环境
|
51
|
+
env =
|
52
|
+
read_user_input(
|
53
|
+
'输入要发布的环境,生产还是测试',
|
54
|
+
'Publish Env(pro or dev)',
|
55
|
+
config['env'],
|
56
|
+
nil
|
57
|
+
)
|
58
|
+
config['env'] = env
|
59
|
+
|
60
|
+
# 读取版本号
|
61
|
+
version =
|
62
|
+
read_user_input(
|
63
|
+
"输入要发布的版本号(#{@specification.attributes_hash['version']} in podspec)",
|
64
|
+
'Component Version',
|
65
|
+
config['version'],
|
66
|
+
nil
|
67
|
+
)
|
68
|
+
config['version'] = version
|
69
|
+
@version = version
|
70
|
+
# 判断podspec中的版本号和输入的版本号是否一致
|
71
|
+
if version != @specification.attributes_hash['version']
|
72
|
+
say "podspec文件中的当前版本号为:#{@specification.attributes_hash['version']},与您输入的要发布的版本号不一致,请修改podspec中的版本号后重试",
|
73
|
+
:red
|
74
|
+
say '', :red
|
75
|
+
|
76
|
+
exit
|
77
|
+
end
|
78
|
+
|
79
|
+
File.open(config_file_path, 'w') { |f| f.write config.to_yaml }
|
80
|
+
|
81
|
+
git = Git.open path
|
82
|
+
|
83
|
+
# 工作区有变动
|
84
|
+
if git.status.changed.keys.length != 0
|
85
|
+
commit_message = "auto: ykioscmd auto commit -- #{version}"
|
86
|
+
git.add
|
87
|
+
git.commit_all commit_message
|
88
|
+
end
|
89
|
+
|
90
|
+
# 检查tag 确认是否删除tag后重新添加
|
91
|
+
check_git_tag git, version
|
92
|
+
|
93
|
+
puts '重新添加tag...'
|
94
|
+
git.add_tag version
|
95
|
+
puts 'git push...'
|
96
|
+
git.push 'origin', git.current_branch, { tags: true }
|
97
|
+
|
98
|
+
Dir.chdir(path) do
|
99
|
+
say '正在入库...', :green
|
100
|
+
repo_name =
|
101
|
+
(
|
102
|
+
if @env == 'dev'
|
103
|
+
'yeahka-app-ios-modules-ykspecs'
|
104
|
+
else
|
105
|
+
'yeahka-app-ios-yeahkanativecomspecsindex'
|
106
|
+
end
|
107
|
+
)
|
108
|
+
system "pod repo push #{repo_name} --allow-warnings --skip-tests"
|
109
|
+
|
110
|
+
result = $?.success?
|
111
|
+
if result
|
112
|
+
say '入库成功', :green
|
113
|
+
say '-----------------------------------------------', :green
|
114
|
+
post_version_deperated_data(path) if @env == 'pro'
|
115
|
+
else
|
116
|
+
say '入库失败,请使用 pod lib lint 和 pod spec lint检查错误信息...', :red
|
117
|
+
say '-----------------------------------------------', :red
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
puts '--'
|
122
|
+
end
|
123
|
+
|
124
|
+
def post_version_deperated_data(path)
|
125
|
+
spec_file_path = find_podspec_file path
|
126
|
+
|
127
|
+
@specification = Pod::Specification.from_file(spec_file_path)
|
128
|
+
@component_name = @specification.name
|
129
|
+
config_file_path = config_file path
|
130
|
+
config = YAML.load_file(config_file_path, {})
|
131
|
+
config['component_name'] = @component_name
|
132
|
+
config['deprecated_versions'] = [] if config['deprecated_versions'].nil?
|
133
|
+
|
134
|
+
old_version_string = config['deprecated_versions'].join(',')
|
135
|
+
|
136
|
+
deprecated_versions =
|
137
|
+
read_user_input(
|
138
|
+
'请上报需要升级的版本号(三位数字版本号,用逗号分隔),无输入则跳过',
|
139
|
+
'Component Deprecated Versions',
|
140
|
+
old_version_string,
|
141
|
+
nil
|
142
|
+
)
|
143
|
+
if deprecated_versions == old_version_string
|
144
|
+
say '跳过过期版本上报......', :yellow
|
145
|
+
exit
|
146
|
+
elsif deprecated_versions
|
147
|
+
.split(',')
|
148
|
+
.each do |version|
|
149
|
+
unless version.match(/\d\.\d.\d/)
|
150
|
+
say '版本号输入不合法', :red
|
151
|
+
exit
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
say '正在上报过期版本......', :yellow
|
157
|
+
config['deprecated_versions'] = config['deprecated_versions'] |
|
158
|
+
deprecated_versions.split(',')
|
159
|
+
File.open(config_file_path, 'w') { |f| f.write config.to_yaml }
|
160
|
+
|
161
|
+
ComponentManagePlatform.new.update_version_info(
|
162
|
+
@component_name,
|
163
|
+
config['deprecated_versions']
|
164
|
+
)
|
165
|
+
end
|
166
|
+
|
167
|
+
def check_git_tag(git, tag)
|
168
|
+
tags = git.tags
|
169
|
+
tag_names = tags.map { |tag| tag.name }
|
170
|
+
return unless tag_names.include? tag or tag_names.include? "v#{tag}"
|
171
|
+
|
172
|
+
is_override =
|
173
|
+
read_user_input(
|
174
|
+
"版本tag #{tag} 已存在",
|
175
|
+
'是否覆盖此版本号(yes or no)',
|
176
|
+
'--',
|
177
|
+
nil
|
178
|
+
)
|
179
|
+
|
180
|
+
if is_override.to_s.downcase == 'yes'
|
181
|
+
puts "正在移除 tag #{tag} ..."
|
182
|
+
git.delete_tag(tag)
|
183
|
+
git.push 'origin', tag, { delete: true }
|
184
|
+
say '旧的的 tag 已经移除', :green
|
185
|
+
else
|
186
|
+
say '此版本号的 tag 重复,请确认覆盖或者修改 podspec 中的版本号后重试...', :red
|
187
|
+
exit
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def config_file(path)
|
192
|
+
config_file_path = "#{path}/#{PODSPEC_CONFIG_FILE}"
|
193
|
+
YkIosCmd::ComponentPublish.source_root(__dir__)
|
194
|
+
unless File.exist?(config_file_path)
|
195
|
+
template_file = "#{__dir__}/component_default.yml"
|
196
|
+
template template_file, config_file_path
|
197
|
+
end
|
198
|
+
config_file_path
|
199
|
+
end
|
200
|
+
|
201
|
+
def read_user_input(desc, ask_prom, now_value, limit)
|
202
|
+
item = ''
|
203
|
+
say "#{desc}:", :green
|
204
|
+
input = ask("#{ask_prom} [#{now_value}] ?")
|
205
|
+
|
206
|
+
if input != ''
|
207
|
+
item = input
|
208
|
+
elsif !now_value.nil? && now_value != ''
|
209
|
+
item = now_value
|
210
|
+
else
|
211
|
+
say "请正确填写#{desc}", :red
|
212
|
+
item = read_user_input(desc, ask_prom, now_value, limit)
|
213
|
+
end
|
214
|
+
item
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
data/lib/ykioscmd.rb
ADDED
data/ykioscmd.gemspec
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/yk_command/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'ykioscmd'
|
7
|
+
spec.version = YkIosCmd::VERSION
|
8
|
+
spec.authors = ['Major Tom']
|
9
|
+
spec.email = ['v2top1@163.com']
|
10
|
+
|
11
|
+
spec.summary = 'a short summary, because RubyGems requires one.'
|
12
|
+
spec.description = 'a longer description or delete this line.'
|
13
|
+
spec.homepage = 'https://github.com/lyleLH'
|
14
|
+
spec.required_ruby_version = '>= 2.6.0'
|
15
|
+
|
16
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/lyleLH/yk_command'
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
spec.bindir = 'bin'
|
29
|
+
spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
|
32
|
+
# Uncomment to register a new dependency of your gem
|
33
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
34
|
+
|
35
|
+
spec.add_development_dependency 'bundler'
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
37
|
+
spec.add_development_dependency 'xcodeproj'
|
38
|
+
|
39
|
+
spec.add_dependency 'git'
|
40
|
+
spec.add_dependency 'bundler'
|
41
|
+
spec.add_dependency 'cocoapods'
|
42
|
+
spec.add_dependency 'cocoapods-core'
|
43
|
+
spec.add_dependency 'xcodeproj'
|
44
|
+
spec.add_dependency 'thor'
|
45
|
+
spec.add_dependency 'colored'
|
46
|
+
spec.add_dependency 'colored2'
|
47
|
+
spec.add_dependency 'httparty'
|
48
|
+
spec.add_dependency 'wechat_work_webhook'
|
49
|
+
spec.add_dependency 'rainbow'
|
50
|
+
spec.add_dependency 'rubyzip'
|
51
|
+
# For more information and examples about making a new gem, checkout our
|
52
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
53
|
+
end
|