cocoapods-nexus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +2 -0
- data/README.md +81 -5
- data/cocoapods-nexus.gemspec +2 -1
- data/lib/cocoapods-nexus/nexus_source.rb +4 -3
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4616b0c7acbb1effc2b43048cbdcd53c6b25ce90df93d29b127280335a0338e
|
4
|
+
data.tar.gz: dadfdb2998cf14ec9cb05d13226ba9bf36330f268aa97b496e3f65af4819fefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 037a12224308415f8a587968d28b7fdc236af9c17af4d68e93e9261198c0bad7f2f654da3d82a2833c9dd58493724ebe3e629b90a94d1ffd24c7ab92573f1a26
|
7
|
+
data.tar.gz: 281ce5eb70a8306be26877c9f4536eaaaa1924dd478f90fad73d22e0b2b86195ff9d47f6e7f2badbda916162d161557a4989403f502e56288d512f0938c97042
|
data/.github/workflows/main.yml
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,87 @@
|
|
1
1
|
# cocoapods-nexus
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/cocoapods-nexus.svg)](https://badge.fury.io/rb/cocoapods-nexus)
|
2
3
|
|
3
|
-
|
4
|
+
让[CocoaPods](https://cocoapods.org/)支持[Nexus](https://www.sonatype.com/nexus)的插件.
|
4
5
|
|
5
|
-
##
|
6
|
+
## 背景
|
6
7
|
|
7
|
-
|
8
|
+
多数管理podspec都是通过git来维护私有库,而随着项目越来越大,cocoapods安装慢、编译慢也成为了问题。常见的解决方式是提前预编译framework来加速。常见的方案有[cocoapods-binary](https://github.com/leavez/cocoapods-binary)、[Rome](https://github.com/tmspzz/Rome)等工具。
|
8
9
|
|
9
|
-
|
10
|
+
考虑团队现有的环境,感觉都不适合现状,团队以有nexus服务器,考虑是否能复用nexus,因此整理出该插件。通过nexus来管理podspec和预编译framework。
|
10
11
|
|
11
|
-
|
12
|
+
## 安装
|
13
|
+
|
14
|
+
```shell
|
15
|
+
$ gem install cocoapods-nexus
|
16
|
+
```
|
17
|
+
|
18
|
+
## 使用
|
19
|
+
|
20
|
+
### 常用命令
|
21
|
+
|
22
|
+
#### Add
|
23
|
+
|
24
|
+
添加一个nexus的repo,类似**pod repo add**
|
25
|
+
|
26
|
+
```shell
|
27
|
+
$ pod nexus add RepoName NexusHostUrl
|
28
|
+
# 例如:
|
29
|
+
# pod nexus add ios_release http://ip:host
|
30
|
+
```
|
31
|
+
|
32
|
+
#### List
|
33
|
+
|
34
|
+
显示已有nexus的repo,类似**pod repo list**
|
35
|
+
|
36
|
+
```shell
|
37
|
+
$ pod nexus list
|
38
|
+
```
|
39
|
+
|
40
|
+
#### Push
|
41
|
+
|
42
|
+
推送podspec到nexus的repo,类似**pod repo push**。其中artifact为可选参数
|
43
|
+
|
44
|
+
```shell
|
45
|
+
$ pod nexus push path/to/podspec --url=NexusHostUrl --repo=RepoName --artifact=path/to/预编译文件
|
46
|
+
|
47
|
+
# 例如:
|
48
|
+
# pod nexus push ~/demo.podspec --url=http://ip:host --repo=ios_release --artifact=~/demo.zip
|
49
|
+
```
|
50
|
+
|
51
|
+
### Podfile配置
|
52
|
+
|
53
|
+
通过如下代码添加nexus的repo
|
54
|
+
```ruby
|
55
|
+
plugin 'cocoapods-nexus', :sources => [
|
56
|
+
{
|
57
|
+
:name => "ios",
|
58
|
+
:url => "http://ip:host",
|
59
|
+
}
|
60
|
+
]
|
61
|
+
|
62
|
+
# 其中name为repo的name,url为nexus的地址
|
63
|
+
# 添加以上代码后执行pod install,插件会从nexus查询podspec
|
64
|
+
```
|
65
|
+
|
66
|
+
## 注意事项
|
67
|
+
|
68
|
+
### 1.如何鉴权
|
69
|
+
|
70
|
+
考虑到nexus会私有部署、通过[~/.netrc](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html)文件配置权限
|
71
|
+
|
72
|
+
```shell
|
73
|
+
machine nexusip
|
74
|
+
login nexus_user
|
75
|
+
password nexus_password
|
76
|
+
```
|
77
|
+
|
78
|
+
### 2.服务器地址
|
79
|
+
|
80
|
+
插件关于nexus的相关操作只需要配置ip和host,后续的mount地址默认为nexus,暂时不支持修改。
|
81
|
+
|
82
|
+
## 致谢
|
83
|
+
|
84
|
+
- [cocoapods-art](https://github.com/jfrog/cocoapods-art)
|
85
|
+
- [cocoapods-repo-svn](https://github.com/dustywusty/cocoapods-repo-svn)
|
86
|
+
- [nexus_api](https://github.com/Cisco-AMP/nexus_api)
|
87
|
+
- 等其他
|
data/cocoapods-nexus.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'cocoapods-nexus'
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ['mrdaios']
|
9
9
|
spec.email = ['mrdaios@gmail.com']
|
10
10
|
spec.description = 'a cocoapods plugin for nexus.'
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'cocoapods', '>= 1.9.3'
|
22
22
|
spec.add_runtime_dependency 'rest-client', '~> 2.1.0'
|
23
|
+
spec.add_runtime_dependency 'versionomy', '~> 0.5.0'
|
23
24
|
|
24
25
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
26
|
spec.add_development_dependency 'rake', '~> 13.0'
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'cocoapods-nexus/api'
|
2
2
|
require 'cocoapods-nexus/downloader'
|
3
|
+
require 'versionomy'
|
3
4
|
|
4
5
|
module Pod
|
5
6
|
class NexusSource < Source
|
@@ -86,12 +87,12 @@ module Pod
|
|
86
87
|
# 解析附件downloadUrl
|
87
88
|
def parse_artifacte_asset_url(artifacte, asset_type)
|
88
89
|
asset = artifacte['assets'].select { |asset| asset['path'].end_with?(asset_type) }.first
|
89
|
-
asset['downloadUrl']
|
90
|
-
end
|
90
|
+
asset['downloadUrl'] if asset && asset['downloadUrl'].nil?
|
91
|
+
end
|
91
92
|
|
92
93
|
def nexus_find_artifacte(spec_name:, spec_version:)
|
93
94
|
artifactes = nexus_api.search_maven_component(artifact_id: spec_name)
|
94
|
-
artifacte = artifactes.select { |artifacte| artifacte['version'].start_with?(spec_version) }.sort_by { |artifacte| artifacte['version']
|
95
|
+
artifacte = artifactes.select { |artifacte| artifacte['version'].start_with?(spec_version) }.sort_by { |artifacte| Versionomy.parse(artifacte['version'])}.last
|
95
96
|
artifacte
|
96
97
|
end
|
97
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-nexus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mrdaios
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.1.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: versionomy
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.5.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.5.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,7 +116,7 @@ homepage: https://github.com/mrdaios/cocoapods-nexus
|
|
102
116
|
licenses:
|
103
117
|
- MIT
|
104
118
|
metadata: {}
|
105
|
-
post_install_message:
|
119
|
+
post_install_message:
|
106
120
|
rdoc_options: []
|
107
121
|
require_paths:
|
108
122
|
- lib
|
@@ -117,8 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
131
|
- !ruby/object:Gem::Version
|
118
132
|
version: '0'
|
119
133
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
121
|
-
signing_key:
|
134
|
+
rubygems_version: 3.1.4
|
135
|
+
signing_key:
|
122
136
|
specification_version: 4
|
123
137
|
summary: 运行时修改spec的source为nexus中的预编译的zip.
|
124
138
|
test_files:
|