vcpkg_pipeline 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vcpkg_pipeline/core/spec.rb +8 -5
- data/lib/vcpkg_pipeline/extension/vcpkg_vpl.rb +26 -14
- 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: 5010aa5bfd34c56e05d6c8a1993d943610c6c1926c751918b1912b8f21e07d4f
|
4
|
+
data.tar.gz: 5ae3189936a34d87a5d8ebe3c177f2553f8893d6f7a94dccfcd22b9ebaff8bae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d71c841df08f944b8c1016419b5590112e563a364a216f2bdef2ba35255258249e569763feb179282dc9fe502b9c8daea7c1661c8dfa94c739346d2fd6e9db6
|
7
|
+
data.tar.gz: 6b67b01c803d575413e8ce5168b3e4f54ceea1ede43456a3aaec1542b0ed6cff89c7c3388523dda759c00271f408d6b16b4880282bbf2bcda1471679acff7869
|
@@ -46,12 +46,15 @@ module VPL
|
|
46
46
|
def distfile_package(output_path = nil)
|
47
47
|
output_path ||= '.'
|
48
48
|
distfile_path = "#{output_path}/#{distfile_name}"
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
VPL.error("Dist包 打包失败: #{distfile_path}")
|
49
|
+
|
50
|
+
zip_sources = []
|
51
|
+
@sources.each do |source|
|
52
|
+
zip_sources += Dir[source]
|
54
53
|
end
|
54
|
+
VPL.info(zip_sources.join('\n'))
|
55
|
+
`zip #{distfile_path} #{zip_sources.join(' ')}`
|
56
|
+
|
57
|
+
VPL.error("Dist包 打包失败: #{distfile_path}") unless File.exist? distfile_path
|
55
58
|
VCPkg.hash(distfile_path)
|
56
59
|
end
|
57
60
|
|
@@ -10,10 +10,6 @@ module VCPkg
|
|
10
10
|
VCPkg::Base.new(path || root)
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.root
|
14
|
-
`echo $VCPKG_ROOT`.sub(/\n/, '')
|
15
|
-
end
|
16
|
-
|
17
13
|
def self.hash(zip_path)
|
18
14
|
`vcpkg hash #{zip_path}`.sub(/\n/, '')
|
19
15
|
end
|
@@ -24,32 +20,48 @@ module VCPkg
|
|
24
20
|
|
25
21
|
# VCPkg::Base
|
26
22
|
class Base
|
27
|
-
attr_accessor :path
|
23
|
+
attr_accessor :path, :git
|
28
24
|
|
29
25
|
def initialize(path)
|
30
26
|
@path = path
|
27
|
+
|
28
|
+
@git = Git.open(@path)
|
31
29
|
end
|
32
30
|
|
33
31
|
def ports
|
34
32
|
"#{@path}/ports"
|
35
33
|
end
|
36
34
|
|
35
|
+
def copy_port(vcport, commit_message)
|
36
|
+
name = vcport.vcpkg.name
|
37
|
+
|
38
|
+
`cp #{vcport.port_path}/* #{ports}/#{name}`
|
39
|
+
@git.add('.')
|
40
|
+
@git.commit(commit_message)
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_version(vcport, commit_message)
|
44
|
+
name = vcport.vcpkg.name
|
45
|
+
|
46
|
+
`vcpkg x-add-version #{name} --vcpkg-root=#{@path}`
|
47
|
+
@git.add('.')
|
48
|
+
@git.commit(commit_message, amend: true)
|
49
|
+
end
|
50
|
+
|
37
51
|
def publish(vcport)
|
38
52
|
name = vcport.vcpkg.name
|
39
|
-
version = vcport.vcpkg.version
|
40
53
|
|
41
|
-
|
54
|
+
@git.quick_stash('保存之前的修改')
|
42
55
|
|
43
|
-
|
56
|
+
port_exist = File.directory? "#{@path}/ports/#{name}"
|
57
|
+
`mkdir -p #{@path}/ports/#{name}` unless port_exist
|
44
58
|
|
45
|
-
|
59
|
+
commit_message = "[#{name}] #{port_exist ? 'Update' : 'Add'} #{vcport.vcpkg.version}"
|
46
60
|
|
47
|
-
|
48
|
-
|
61
|
+
copy_port(vcport, commit_message)
|
62
|
+
add_version(vcport, commit_message)
|
49
63
|
|
50
|
-
|
51
|
-
git_vcpkg.commit("[#{name}] #{port_exist ? 'Update' : 'Add'} #{version}")
|
52
|
-
git_vcpkg.quick_push
|
64
|
+
@git.quick_push
|
53
65
|
end
|
54
66
|
end
|
55
67
|
end
|