kpm 0.10.4 → 0.10.6

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: e69269a01b07d01247f91c4928f795a6082798e29b7dc80e0f9dcff7bbf052ff
4
- data.tar.gz: 474ccaea9db693606babde9a94ba21d3f53c087bd0735c6c93c36e38451ad264
3
+ metadata.gz: c9d067585651d10d1377daef5f789c6fede0463b1f8c77f27441dc014afd29de
4
+ data.tar.gz: 70fed604e143d6ff2a8447d65aaae4037e4b6b45c8a9c83aadbce1f978b9f203
5
5
  SHA512:
6
- metadata.gz: a4b59ab0cfc80647365f04679782e4dbe089948d54b900e7a677989f4b36fc021a5c02210985f7773d139ca4644f1c2c572e6eb39c28d754eb6986856af6f4ef
7
- data.tar.gz: 66a4b7a14509ae8ef03d05636bf37312e11363b9e6da5de743d46bd78c7fd096dff2d81ef9466ba13c2661b4dc166d51d502d540f38c1532872a1816708a0648
6
+ metadata.gz: 488cb74c64870f6e01654cf47c6b3cab6f5fe86c482e50ec7a7fb5beacfedcc985a1d1a47555670a71b5a69e6de0ac30e2dc1e1bf55a7fbf8492dbf9dd20e6a6
7
+ data.tar.gz: b2c3fe934618af88d9708760b7c0c656976937f19e51ef3af3257ec45e084a48e8e843255f3b60ac9a74aacadc0c6d2607378b71ba9b41a4552624d597810757
data/.gitignore CHANGED
@@ -2,10 +2,12 @@ Gemfile.lock
2
2
  pkg
3
3
  packaging/tmp
4
4
  packaging/vendor
5
- kpm-*-linux-x86.tar.gz
6
5
  kpm-*-linux-x86_64.tar.gz
6
+ kpm-*-osx-arm64.tar.gz
7
7
  kpm-*-osx.tar.gz
8
- traveling-ruby-*.tar.gz
8
+ kpm-*-noarch.tar.gz
9
+ portable-ruby-*.tar.gz
10
+ jruby-dist-*-bin.tar.gz
9
11
  *.asc
10
12
  .rakeTasks
11
13
  pom.xml.versionsBackup
@@ -147,7 +147,7 @@ module KPM
147
147
  case response.code
148
148
  when '200'
149
149
  response.body
150
- when '301', '307'
150
+ when '301', '302', '307'
151
151
  location = response['Location']
152
152
  logger.debug { "Following redirect to #{location}" }
153
153
 
@@ -13,7 +13,7 @@
13
13
  :versions:
14
14
  :0.18: 4.2.5
15
15
  :0.20: 6.0.1
16
- :0.22: 7.2.3
16
+ :0.22: 7.2.7
17
17
  :avatax:
18
18
  :type: :java
19
19
  :versions:
data/lib/kpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KPM
4
- VERSION = '0.10.4'
4
+ VERSION = '0.10.6'
5
5
  end
data/packaging/Gemfile CHANGED
@@ -3,7 +3,4 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gem 'kpm', '~> VERSION'
6
-
7
- group :development do
8
- gem 'rake'
9
- end
6
+ gem 'rake'
data/packaging/kpm.sh CHANGED
@@ -11,4 +11,4 @@ unset BUNDLE_IGNORE_CONFIG
11
11
 
12
12
  # Run the actual app using the bundled Ruby interpreter, with Bundler activated.
13
13
  # See https://github.com/phusion/traveling-ruby/issues/58
14
- exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline $SELFDIR/lib/vendor/ruby/2.*/bin/kpm $@
14
+ exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline $SELFDIR/lib/vendor/*ruby/2.*/bin/kpm $@
data/pom.xml CHANGED
@@ -22,7 +22,7 @@
22
22
  <modelVersion>4.0.0</modelVersion>
23
23
  <groupId>org.kill-bill.billing.installer</groupId>
24
24
  <artifactId>kpm</artifactId>
25
- <version>0.10.4</version>
25
+ <version>0.10.6</version>
26
26
  <packaging>pom</packaging>
27
27
  <name>KPM</name>
28
28
  <description>KPM: the Kill Bill Package Manager</description>
@@ -147,11 +147,6 @@
147
147
  </goals>
148
148
  <configuration>
149
149
  <artifacts>
150
- <artifact>
151
- <file>kpm-${project.version}-linux-x86.tar.gz</file>
152
- <type>tar.gz</type>
153
- <classifier>linux-x86</classifier>
154
- </artifact>
155
150
  <artifact>
156
151
  <file>kpm-${project.version}-linux-x86_64.tar.gz</file>
157
152
  <type>tar.gz</type>
@@ -162,6 +157,16 @@
162
157
  <type>tar.gz</type>
163
158
  <classifier>osx</classifier>
164
159
  </artifact>
160
+ <artifact>
161
+ <file>kpm-${project.version}-osx-arm64.tar.gz</file>
162
+ <type>tar.gz</type>
163
+ <classifier>osx-arm64</classifier>
164
+ </artifact>
165
+ <artifact>
166
+ <file>kpm-${project.version}-noarch.tar.gz</file>
167
+ <type>tar.gz</type>
168
+ <classifier>noarch</classifier>
169
+ </artifact>
165
170
  </artifacts>
166
171
  </configuration>
167
172
  </execution>
data/tasks/package.rake CHANGED
@@ -9,33 +9,50 @@ PACKAGE_NAME = 'kpm'
9
9
  require './lib/kpm/version'
10
10
  VERSION = KPM::VERSION
11
11
 
12
- # See https://traveling-ruby.s3-us-west-2.amazonaws.com/list.html
13
- TRAVELING_RUBY_VERSION = '20150715-2.2.2'
12
+ # See https://www.jruby.org/download
13
+ JRUBY_VERSION = '9.3.4.0'
14
+ # See https://github.com/Homebrew/homebrew-portable-ruby/releases
15
+ HOMEBREW_PORTABLE_RUBY_VERSION = '2.6.8_1'
14
16
 
15
17
  # Remove unused files to reduce package size
16
18
  GEMS_PATH = 'packaging/vendor/ruby/*/gems/*/'
17
19
  REMOVE_FILES = %w[test tests spec README* CHANGE* Change* COPYING* LICENSE* MIT-LICENSE* doc docs examples ext/*/Makefile .gitignore .travis.yml].freeze
18
20
  REMOVE_EXTENSIONS = %w[*.md *.c *.h *.rl extconf.rb *.java *.class *.so *.o].freeze
19
21
 
22
+ NOARCH_TARGET = 'noarch'
23
+ LINUX_X86_TARGET = 'x86_64_linux'
24
+ OSX_X86_TARGET = 'el_capitan'
25
+ OSX_ARM_TARGET = 'arm64_big_sur'
26
+
20
27
  desc 'Package your app'
21
- task package: %w[package:linux:x86 package:linux:x86_64 package:osx]
28
+ task package: %w[package:noarch package:linux:x86_64 package:osx:x86_64 package:osx:arm64]
22
29
 
23
30
  namespace :package do
24
- namespace :linux do
25
- desc 'Package KPM for Linux x86'
26
- task x86: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86.tar.gz"] do
27
- create_package('linux-x86')
28
- end
31
+ desc 'Package KPM (noarch)'
32
+ task noarch: [:bundle_install, "packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz"] do
33
+ create_package(NOARCH_TARGET, 'noarch')
34
+ end
29
35
 
36
+ namespace :linux do
30
37
  desc 'Package KPM for Linux x86_64'
31
- task x86_64: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64.tar.gz"] do
32
- create_package('linux-x86_64')
38
+ task x86_64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{LINUX_X86_TARGET}.bottle.tar.gz"] do
39
+ ensure_ruby_version
40
+ create_package(LINUX_X86_TARGET, 'linux-x86_64')
33
41
  end
34
42
  end
35
43
 
36
- desc 'Package KPM for OS X'
37
- task osx: [:bundle_install, "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx.tar.gz"] do
38
- create_package('osx')
44
+ namespace :osx do
45
+ desc 'Package KPM for OSX x86_64'
46
+ task x86_64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_X86_TARGET}.bottle.tar.gz"] do
47
+ ensure_ruby_version
48
+ create_package(OSX_X86_TARGET, 'osx')
49
+ end
50
+
51
+ desc 'Package KPM for OSX arm64'
52
+ task arm64: [:bundle_install, "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_ARM_TARGET}.bottle.tar.gz"] do
53
+ ensure_ruby_version
54
+ create_package(OSX_ARM_TARGET, 'osx-arm64')
55
+ end
39
56
  end
40
57
 
41
58
  desc 'Install gems to local directory'
@@ -43,15 +60,12 @@ namespace :package do
43
60
  # abort if version packaging does not exist on repository
44
61
  abort "KPM #{VERSION} does not exists in the repository." unless gem_exists?
45
62
 
46
- # Note! Must match TRAVELING_RUBY_VERSION above
47
- expected_ruby_version = TRAVELING_RUBY_VERSION.split('-')[-1]
48
- abort "You can only 'bundle install' using Ruby #{expected_ruby_version}, because that's what Traveling Ruby uses." if RUBY_VERSION !~ /#{Regexp.quote(expected_ruby_version)}/
49
63
  sh 'rm -rf packaging/tmp'
50
64
  sh 'mkdir -p packaging/tmp'
51
65
  sh 'cp packaging/Gemfile packaging/tmp/'
52
66
  sh "sed -i 's/VERSION/#{VERSION}/g' packaging/tmp/Gemfile"
53
67
 
54
- sh "rm -rf packaging/vendor/ruby/#{expected_ruby_version}/bundler" # if multiple clones of same repo, may load in wrong one
68
+ sh 'rm -rf packaging/vendor/ruby/2.*/bundler' # if multiple clones of same repo, may load in wrong one
55
69
 
56
70
  Bundler.with_clean_env do
57
71
  sh 'cd packaging/tmp && env BUNDLE_IGNORE_CONFIG=1 bundle install --path ../vendor --without development'
@@ -80,28 +94,42 @@ namespace :package do
80
94
  end
81
95
  end
82
96
 
83
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86.tar.gz" do
84
- download_runtime('linux-x86')
97
+ file "packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz" do
98
+ download_noarch_runtime
85
99
  end
86
100
 
87
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64.tar.gz" do
88
- download_runtime('linux-x86_64')
101
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{LINUX_X86_TARGET}.bottle.tar.gz" do
102
+ download_portable_runtime(LINUX_X86_TARGET)
89
103
  end
90
104
 
91
- file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx.tar.gz" do
92
- download_runtime('osx')
105
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_X86_TARGET}.bottle.tar.gz" do
106
+ download_portable_runtime(OSX_X86_TARGET)
93
107
  end
94
108
 
95
- def create_package(target)
96
- package_dir = "#{PACKAGE_NAME}-#{VERSION}-#{target}"
109
+ file "packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{OSX_ARM_TARGET}.bottle.tar.gz" do
110
+ download_portable_runtime(OSX_ARM_TARGET)
111
+ end
112
+
113
+ def create_package(target, package_dir_suffix)
114
+ pom_version = %r{<version>(.*)</version>}.match(File.read("#{__dir__}/../pom.xml"))[1]
115
+ package_dir = "#{PACKAGE_NAME}-#{pom_version}-#{package_dir_suffix}"
97
116
  sh "rm -rf #{package_dir}"
98
117
  sh "mkdir -p #{package_dir}/lib/ruby"
99
- sh "tar -xzf packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}.tar.gz -C #{package_dir}/lib/ruby"
118
+ if target == NOARCH_TARGET
119
+ sh "tar -xzf packaging/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz -C #{package_dir}/lib/ruby --strip-components 1"
120
+ else
121
+ sh "tar -xzf packaging/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{target}.bottle.tar.gz -C #{package_dir}/lib/ruby --strip-components 2"
122
+ end
100
123
 
101
124
  sh "cp packaging/kpm.sh #{package_dir}/kpm"
102
125
  sh "chmod +x packaging/kpm.sh #{package_dir}/kpm"
103
126
 
104
127
  sh "cp -pR packaging/vendor #{package_dir}/lib/"
128
+ if target == NOARCH_TARGET
129
+ # Need to tweak a few things to make it work with JRuby
130
+ sh "cp #{package_dir}/lib/ruby/bin/jruby #{package_dir}/lib/ruby/bin/ruby"
131
+ sh "mv #{package_dir}/lib/vendor/ruby #{package_dir}/lib/vendor/jruby"
132
+ end
105
133
 
106
134
  sh "cp packaging/Gemfile* #{package_dir}/lib/vendor/"
107
135
  sh "sed -i 's/VERSION/#{VERSION}/g' #{package_dir}/lib/vendor/Gemfile"
@@ -114,9 +142,14 @@ def create_package(target)
114
142
  sh "rm -rf #{package_dir}"
115
143
  end
116
144
 
117
- def download_runtime(target)
145
+ def download_noarch_runtime
146
+ sh 'mkdir -p packaging && cd packaging && curl -L -O --fail ' \
147
+ "https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{JRUBY_VERSION}/jruby-dist-#{JRUBY_VERSION}-bin.tar.gz"
148
+ end
149
+
150
+ def download_portable_runtime(target)
118
151
  sh 'mkdir -p packaging && cd packaging && curl -L -O --fail ' \
119
- "https://d6r77u77i8pq3.cloudfront.net/releases/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}.tar.gz"
152
+ "https://github.com/Homebrew/homebrew-portable-ruby/releases/download/#{HOMEBREW_PORTABLE_RUBY_VERSION}/portable-ruby-#{HOMEBREW_PORTABLE_RUBY_VERSION}.#{target}.bottle.tar.gz"
120
153
  end
121
154
 
122
155
  def gem_exists?
@@ -126,3 +159,9 @@ def gem_exists?
126
159
  specification = YAML.load(response)
127
160
  specification.instance_of?(Gem::Specification)
128
161
  end
162
+
163
+ def ensure_ruby_version
164
+ # Note! Must match HOMEBREW_PORTABLE_RUBY_VERSION above
165
+ expected_ruby_version = HOMEBREW_PORTABLE_RUBY_VERSION.split('_')[0]
166
+ abort "You can only 'bundle install' using Ruby #{expected_ruby_version}, because that's what homebrew-portable-ruby uses." if RUBY_VERSION !~ /#{Regexp.quote(expected_ruby_version)}/
167
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-18 00:00:00.000000000 Z
11
+ date: 2023-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.88.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.88.0
111
125
  description: A package manager for Kill Bill.
112
126
  email: killbilling-users@googlegroups.com
113
127
  executables:
@@ -168,7 +182,6 @@ files:
168
182
  - packaging/bundler-config
169
183
  - packaging/kpm.sh
170
184
  - pom.xml
171
- - release.sh
172
185
  - spec/kpm/remote/base_artifact_spec.rb
173
186
  - spec/kpm/remote/base_installer_spec.rb
174
187
  - spec/kpm/remote/cloudsmith_api_calls_spec.rb
@@ -223,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
236
  - !ruby/object:Gem::Version
224
237
  version: '0'
225
238
  requirements: []
226
- rubygems_version: 3.0.8
239
+ rubygems_version: 3.0.3.1
227
240
  signing_key:
228
241
  specification_version: 4
229
242
  summary: Kill Bill package manager.
data/release.sh DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
-
5
- BUNDLE=${BUNDLE-"bundle exec"}
6
- MVN=${MVN-"mvn"}
7
-
8
- if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
9
- echo 'Unable to release: make sure to use GNU tar'
10
- exit 1
11
- fi
12
-
13
- # See TRAVELING_RUBY_VERSION in tasks/package.rake
14
- if [[ "$(ruby --version 2>&1 | tail -1 | awk '{print $2}')" != 2.2.2* ]]; then
15
- echo 'Ruby version 2.2.2 is required'
16
- exit 1
17
- fi
18
-
19
- VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
20
- if [[ -z "$NO_RELEASE" && "$VERSION" != "$(ruby -r./lib/kpm/version.rb -e "print KPM::VERSION")" ]]; then
21
- echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
22
- exit 1
23
- fi
24
-
25
- if [[ -z "$NO_RELEASE" ]]; then
26
- echo 'Pushing the gem to Rubygems'
27
- $BUNDLE rake release
28
- fi
29
-
30
- # Wait for the gem to be propagated
31
- sleep 15
32
-
33
- $BUNDLE rake package
34
-
35
- if [[ -z "$NO_RELEASE" ]]; then
36
- GOAL=gpg:sign-and-deploy-file
37
- REPOSITORY_ID=ossrh-releases
38
- URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
39
- REPO_VERSION=$VERSION
40
- else
41
- GOAL=deploy:deploy-file
42
- REPOSITORY_ID=sonatype-nexus-snapshots
43
- URL=https://oss.sonatype.org/content/repositories/snapshots/
44
- REPO_VERSION="$VERSION-SNAPSHOT"
45
- fi
46
-
47
- echo "Pushing artifacts to Maven Central"
48
- $MVN $GOAL \
49
- -DgroupId=org.kill-bill.billing.installer \
50
- -DartifactId=kpm \
51
- -Dversion=$REPO_VERSION \
52
- -Dpackaging=tar.gz \
53
- -DrepositoryId=$REPOSITORY_ID \
54
- -Durl=$URL \
55
- -Dfile=kpm-$VERSION-linux-x86_64.tar.gz \
56
- -Dclassifier=linux-x86_64 \
57
- -Dfiles=kpm-$VERSION-linux-x86.tar.gz,kpm-$VERSION-osx.tar.gz \
58
- -Dclassifiers=linux-x86,osx \
59
- -Dtypes=tar.gz,tar.gz \
60
- -DpomFile=pom.xml