gjp 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -132,6 +132,20 @@ You can also edit the specs file manually if you want. When you later regenerate
132
132
 
133
133
  OBS users: note that the output/ directory created by gjp can be submitted or used as OBS project. Feel free to replace it with a symlink pointing at your home OBS project, or use symlinks from your OBS project to its contents.
134
134
 
135
+ #### Quicker workflow
136
+
137
+ `gjp` also has a `generate-all` subcommand that will generate everything in one step. Thus, for Maven-based projects, the minimal workflow is:
138
+
139
+ cd src
140
+ mkdir <package_name>
141
+ cd <package_name>
142
+ wget <sources>
143
+ ...
144
+ gjp dry-run
145
+ gjp mvn package
146
+ gjp finish
147
+ gjp generate-all
148
+
135
149
  #### Ant packages
136
150
 
137
151
  Building Ant packages is not really different from Maven ones, as `gjp ant` will operate exactly like `gjp mvn`.
@@ -25,11 +25,7 @@ cd src/commons-collections/commons-collections-3.2.1-src/
25
25
  gjp mvn package -DskipTests
26
26
  gjp finish
27
27
 
28
- gjp generate-kit-archive
29
- gjp generate-kit-spec
30
- gjp generate-package-script
31
- gjp generate-package-archive
32
- gjp generate-package-spec
28
+ gjp generate-all
33
29
  cd ../../..
34
30
 
35
31
  cd src
data/lib/gjp/cli.rb CHANGED
@@ -114,10 +114,7 @@ module Gjp
114
114
  checking_exceptions do
115
115
  project = Gjp::Project.new(".")
116
116
  result_path, conflict_count = Gjp::SpecGenerator.new(project).generate_kit_spec
117
- puts "#{format_path(result_path, project)} generated"
118
- if conflict_count > 0
119
- puts "Warning: #{conflict_count} unresolved conflicts"
120
- end
117
+ print_generation_result(project, result_path, conflict_count)
121
118
  end
122
119
  end
123
120
  end
@@ -128,7 +125,7 @@ module Gjp
128
125
  checking_exceptions do
129
126
  project = Gjp::Project.new(".")
130
127
  result_path = Gjp::Archiver.new(project).archive_kit(incremental?)
131
- puts "#{format_path(result_path, project)} generated"
128
+ print_generation_result(project, result_path)
132
129
  end
133
130
  end
134
131
  end
@@ -141,10 +138,7 @@ module Gjp
141
138
  package_name = project.get_package_name(directory)
142
139
  history_file = File.join(Dir.home, ".bash_history")
143
140
  result_path, conflict_count = Gjp::ScriptGenerator.new(project, history_file).generate_build_script(package_name)
144
- puts "#{format_path(result_path, project)} generated"
145
- if conflict_count > 0
146
- puts "Warning: #{conflict_count} unresolved conflicts"
147
- end
141
+ print_generation_result(project, result_path, conflict_count)
148
142
  end
149
143
  end
150
144
  end
@@ -158,10 +152,7 @@ module Gjp
158
152
  project = Gjp::Project.new(".")
159
153
  package_name = project.get_package_name(directory)
160
154
  result_path, conflict_count = Gjp::SpecGenerator.new(project).generate_package_spec package_name, pom, filter
161
- puts "#{format_path(result_path, project)} generated"
162
- if conflict_count > 0
163
- puts "Warning: #{conflict_count} unresolved conflicts"
164
- end
155
+ print_generation_result(project, result_path, conflict_count)
165
156
  end
166
157
  end
167
158
  end
@@ -173,7 +164,36 @@ module Gjp
173
164
  project = Gjp::Project.new(".")
174
165
  package_name = project.get_package_name(directory)
175
166
  result_path = Gjp::Archiver.new(project).archive_package package_name
176
- puts "#{format_path(result_path, project)} generated"
167
+ print_generation_result(project, result_path)
168
+ end
169
+ end
170
+ end
171
+
172
+ subcommand "generate-all", "Create or refresh specs, archives, scripts for a package and the kit" do
173
+ option ["-f", "--filter"], "FILTER", "filter files to be installed by this package spec", :default => "*.jar"
174
+ option ["-i", "--incremental"], :flag, "create a kit archive with only the difference from the previous one", :default => true
175
+ parameter "[DIRECTORY]", "path to a package directory (src/<package name>)", :default => "."
176
+ parameter "[POM]", "a package pom file path", :default => "pom.xml"
177
+ def execute
178
+ checking_exceptions do
179
+ project = Gjp::Project.new(".")
180
+ package_name = project.get_package_name(directory)
181
+
182
+ result_path = Gjp::Archiver.new(project).archive_kit(incremental?)
183
+ print_generation_result(project, result_path)
184
+
185
+ result_path, conflict_count = Gjp::SpecGenerator.new(project).generate_kit_spec
186
+ print_generation_result(project, result_path, conflict_count)
187
+
188
+ history_file = File.join(Dir.home, ".bash_history")
189
+ result_path, conflict_count = Gjp::ScriptGenerator.new(project, history_file).generate_build_script(package_name)
190
+ print_generation_result(project, result_path, conflict_count)
191
+
192
+ result_path = Gjp::Archiver.new(project).archive_package package_name
193
+ print_generation_result(project, result_path)
194
+
195
+ result_path, conflict_count = Gjp::SpecGenerator.new(project).generate_package_spec package_name, pom, filter
196
+ print_generation_result(project, result_path, conflict_count)
177
197
  end
178
198
  end
179
199
  end
@@ -254,6 +274,16 @@ module Gjp
254
274
  end
255
275
  end
256
276
 
277
+ private
278
+
279
+ # outputs output of a file generation
280
+ def print_generation_result(project, result_path, conflict_count = 0)
281
+ puts "#{format_path(result_path, project)} generated"
282
+ if conflict_count > 0
283
+ puts "Warning: #{conflict_count} unresolved conflicts"
284
+ end
285
+ end
286
+
257
287
  # generates a version of path relative to the current directory
258
288
  def format_path(path, project)
259
289
  full_path = if Pathname.new(path).relative?
data/lib/gjp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Gjp
4
- VERSION = "0.25.0"
4
+ VERSION = "0.26.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: