cocoapods-azure-universal-packages 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca06f2fa1acb83909c756ba68cad5e3e4d150c3dd9e19cc48f2e0411e2a75146
|
4
|
+
data.tar.gz: 293193c33ad6c5ab0965d376f8f4186ebb1d20c1154cd69f90bd5ac63d18786f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11a6165328795b41d91fc765baae5050a42daf7e26a47647c96b8895fb034407c00602246fa1b3858987bf89df93e3fba0e8750d4824a0237f5632e35a98e5f9
|
7
|
+
data.tar.gz: 49308552fd05e90fe50c935ee085cf7c86cc045435c1dc8ac0ba8297f96a86919535e343dd9384898e60115d01be32d9d3818d054bc44297f51b0719d6c5caa2
|
data/README.md
CHANGED
@@ -30,22 +30,21 @@ _Note:_ The plugin will install the Azure CLI [DevOps extension](https://github.
|
|
30
30
|
Add to your Podfile
|
31
31
|
```Ruby
|
32
32
|
plugin 'cocoapods-azure-universal-packages', {
|
33
|
-
:
|
33
|
+
:organization => '{{ORGANIZATION_URL}}'
|
34
34
|
}
|
35
35
|
```
|
36
|
-
replacing `{{
|
36
|
+
replacing `{{ORGANIZATION_URL}}` with the base URL of your Azure Artifacts feed (for example: `https://pkgs.dev.azure.com/myorg`).
|
37
37
|
|
38
38
|
Then, in your podspec set the pod's source to
|
39
39
|
```Ruby
|
40
40
|
# For project scoped feeds:
|
41
|
-
spec.source = { :http => '{{
|
41
|
+
spec.source = { :http => '{{ORGANIZATION_URL}}/{{PROJECT}}/_apis/packaging/feeds/{{FEED}}/upack/packages/{{PACKAGE}}/versions/{{VERSION}}' }
|
42
42
|
|
43
43
|
# For organization scoped feeds:
|
44
|
-
spec.source = { :http => '{{
|
44
|
+
spec.source = { :http => '{{ORGANIZATION_URL}}/_apis/packaging/feeds/{{FEED}}/upack/packages/{{PACKAGE}}/versions/{{VERSION}}' }
|
45
45
|
```
|
46
46
|
where:
|
47
|
-
- `{{
|
48
|
-
- `{{ORGANIZATION}}` is the name of your feed's organization
|
47
|
+
- `{{ORGANIZATION_URL}}` is the URL of your feed's organization
|
49
48
|
- `{{PROJECT}}` is the name of your feed's project (you must specify this only if your feed is a project scoped feed)
|
50
49
|
- `{{PACKAGE}}` is the name of your universal package
|
51
50
|
- `{{VERSION}}` is the version of your universal package
|
@@ -54,8 +53,8 @@ where:
|
|
54
53
|
|
55
54
|
| Parameter | Description |
|
56
55
|
| --------- | ----------- |
|
57
|
-
| `
|
58
|
-
| `
|
56
|
+
| `organization` | The URL of the Azure Artifacts feed's orgnization. Required unless `organizations` is specified. |
|
57
|
+
| `organizations` | An array of URLs of possible Azure Artifacts feeds' organizations. Required unless `organization` is specified. |
|
59
58
|
| `update_cli_extension` | Whether to update the Azure CLI DevOps extensions automatically. Default to `false`. |
|
60
59
|
|
61
60
|
## Run tests for this plugin
|
@@ -5,10 +5,10 @@ require 'cocoapods-downloader'
|
|
5
5
|
module Pod
|
6
6
|
module Downloader
|
7
7
|
|
8
|
-
@
|
8
|
+
@azure_organizations = []
|
9
9
|
|
10
10
|
class << self
|
11
|
-
attr_accessor :
|
11
|
+
attr_accessor :azure_organizations
|
12
12
|
end
|
13
13
|
|
14
14
|
class Http
|
@@ -20,39 +20,49 @@ module Pod
|
|
20
20
|
executable :az
|
21
21
|
|
22
22
|
def download!
|
23
|
-
|
24
|
-
|
25
|
-
)
|
26
|
-
uri = Addressable::URI.parse(url)
|
27
|
-
aup_uri_components = aup_uri_template.extract(uri)
|
23
|
+
# Check if the url matches any known Azure organization
|
24
|
+
organization = Downloader.azure_organizations.find { |org| url.to_s.start_with?(org) }
|
28
25
|
|
29
|
-
if
|
30
|
-
|
26
|
+
if organization.nil?
|
27
|
+
aliased_download!
|
28
|
+
else
|
29
|
+
# Parse the url
|
30
|
+
organization.delete_suffix!('/')
|
31
|
+
aup_uri_template = Addressable::Template.new(
|
32
|
+
"#{organization}{/project}/_apis/packaging/feeds/{feed}/upack/packages/{package}/versions/{version}"
|
33
|
+
)
|
34
|
+
uri = Addressable::URI.parse(url)
|
35
|
+
aup_uri_components = aup_uri_template.extract(uri)
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
file
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
37
|
+
if !aup_uri_components.nil?
|
38
|
+
download_azure_universal_package!(aup_uri_components.merge({ 'organization' => organization }))
|
39
|
+
|
40
|
+
# Extract the file if it's the only one in the package
|
41
|
+
package_files = target_path.glob('*')
|
42
|
+
if package_files.count == 1 && package_files.first.file?
|
43
|
+
file = package_files.first
|
44
|
+
file_type = begin
|
45
|
+
case file.to_s
|
46
|
+
when /\.zip$/
|
47
|
+
:zip
|
48
|
+
when /\.(tgz|tar\.gz)$/
|
49
|
+
:tgz
|
50
|
+
when /\.tar$/
|
51
|
+
:tar
|
52
|
+
when /\.(tbz|tar\.bz2)$/
|
53
|
+
:tbz
|
54
|
+
when /\.(txz|tar\.xz)$/
|
55
|
+
:txz
|
56
|
+
when /\.dmg$/
|
57
|
+
:dmg
|
58
|
+
end
|
50
59
|
end
|
60
|
+
extract_with_type(file, file_type) unless file_type.nil?
|
51
61
|
end
|
52
|
-
|
62
|
+
else
|
63
|
+
Pod::UserInterface.warn("#{url} looks like a Azure artifact feed but it's malformed")
|
64
|
+
aliased_download!
|
53
65
|
end
|
54
|
-
else
|
55
|
-
aliased_download!
|
56
66
|
end
|
57
67
|
end
|
58
68
|
|
@@ -62,7 +72,7 @@ module Pod
|
|
62
72
|
'artifacts',
|
63
73
|
'universal',
|
64
74
|
'download',
|
65
|
-
'--organization',
|
75
|
+
'--organization', params['organization'],
|
66
76
|
'--feed', params['feed'],
|
67
77
|
'--name', params['package'],
|
68
78
|
'--version', params['version'],
|
@@ -18,11 +18,11 @@ module CocoapodsAzureUniversalPackages
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# Now we can configure the downloader to use the Azure CLI for downloading pods from the given hosts
|
21
|
-
|
22
|
-
raise Pod::Informative, 'You must configure at least one Azure
|
21
|
+
azure_organizations = options[:organization] || options[:organizations]
|
22
|
+
raise Pod::Informative, 'You must configure at least one Azure organization' unless azure_organizations
|
23
23
|
|
24
|
-
Pod::Downloader.
|
25
|
-
raise Pod::Informative, 'You must configure at least one Azure
|
24
|
+
Pod::Downloader.azure_organizations = ([] << azure_organizations).flatten.map { |url| url.delete_suffix('/') }
|
25
|
+
raise Pod::Informative, 'You must configure at least one Azure organization' if Pod::Downloader.azure_organizations.empty?
|
26
26
|
end
|
27
27
|
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-azure-universal-packages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.0.3
|
129
|
+
rubygems_version: 3.0.3.1
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: A CocoaPods plugin for downloading Universal Packages from Azure Artifacts
|