gjp 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,153 @@
1
+
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+
5
+ <parent>
6
+ <groupId>org.sonatype.oss</groupId>
7
+ <artifactId>oss-parent</artifactId>
8
+ <version>7</version>
9
+ </parent>
10
+
11
+ <groupId>com.martiansoftware</groupId>
12
+ <artifactId>nailgun-all</artifactId>
13
+ <version>0.9.1</version>
14
+ <packaging>pom</packaging>
15
+
16
+ <properties>
17
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18
+ </properties>
19
+
20
+ <name>nailgun-all</name>
21
+ <description>
22
+ Nailgun is a client, protocol, and server for running Java programs
23
+ from the command line without incurring the JVM startup overhead.
24
+ Programs run in the server (which is implemented in Java), and are
25
+ triggered by the client (written in C), which handles all I/O.
26
+
27
+ This project contains the server and examples.
28
+ </description>
29
+ <url>http://martiansoftware.com/nailgun</url>
30
+
31
+ <licenses>
32
+ <license>
33
+ <name>The Apache Software License, Version 2.0</name>
34
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
35
+ <distribution>repo</distribution>
36
+ </license>
37
+ </licenses>
38
+
39
+ <scm>
40
+ <url>scm:git:git@github.com:martylamb/nailgun.git</url>
41
+ <connection>scm:git:git@github.com:martylamb/nailgun.git</connection>
42
+ <developerConnection>scm:git:git@github.com:martylamb/nailgun.git</developerConnection>
43
+ <tag>nailgun-all-0.9.1</tag>
44
+ </scm>
45
+
46
+ <developers>
47
+ <developer>
48
+ <email>mlamb@martiansoftware.com</email>
49
+ <name>Marty Lamb</name>
50
+ <url>http://martiansoftware.com</url>
51
+ </developer>
52
+ </developers>
53
+
54
+ <modules>
55
+ <module>nailgun-server</module>
56
+ <module>nailgun-examples</module>
57
+ </modules>
58
+
59
+ <build>
60
+ <plugins>
61
+ <plugin>
62
+ <groupId>org.apache.maven.plugins</groupId>
63
+ <artifactId>maven-compiler-plugin</artifactId>
64
+ <version>3.0</version>
65
+ <configuration>
66
+ <source>1.4</source>
67
+ <target>1.4</target>
68
+ </configuration>
69
+ </plugin>
70
+ <plugin>
71
+ <groupId>org.apache.maven.plugins</groupId>
72
+ <artifactId>maven-source-plugin</artifactId>
73
+ <version>2.2.1</version>
74
+ <executions>
75
+ <execution>
76
+ <id>attach-sources</id>
77
+ <goals>
78
+ <goal>jar</goal>
79
+ </goals>
80
+ </execution>
81
+ </executions>
82
+ </plugin>
83
+ <plugin>
84
+ <groupId>org.apache.maven.plugins</groupId>
85
+ <artifactId>maven-javadoc-plugin</artifactId>
86
+ <version>2.9</version>
87
+ <executions>
88
+ <execution>
89
+ <id>attach-javadocs</id>
90
+ <goals>
91
+ <goal>jar</goal>
92
+ </goals>
93
+ </execution>
94
+ </executions>
95
+ </plugin>
96
+ <plugin>
97
+ <groupId>org.apache.maven.plugins</groupId>
98
+ <artifactId>maven-release-plugin</artifactId>
99
+ <version>2.3.2</version>
100
+ <configuration>
101
+ <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
102
+ </configuration>
103
+ </plugin>
104
+ </plugins>
105
+ </build>
106
+
107
+ <distributionManagement>
108
+ <snapshotRepository>
109
+ <id>sonatype-nexus-snapshots</id>
110
+ <name>Sonatype Nexus snapshot repository</name>
111
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
112
+ </snapshotRepository>
113
+ <repository>
114
+ <id>sonatype-nexus-staging</id>
115
+ <name>Sonatype Nexus release repository</name>
116
+ <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
117
+ </repository>
118
+ </distributionManagement>
119
+
120
+ <profiles>
121
+ <profile>
122
+ <id>release-sign-artifacts</id>
123
+ <activation>
124
+ <property>
125
+ <name>performRelease</name>
126
+ <value>true</value>
127
+ </property>
128
+ </activation>
129
+ <build>
130
+ <plugins>
131
+ <plugin>
132
+ <groupId>org.apache.maven.plugins</groupId>
133
+ <artifactId>maven-gpg-plugin</artifactId>
134
+ <version>1.4</version>
135
+ <configuration>
136
+ <passphrase>${gpg.passphrase}</passphrase>
137
+ </configuration>
138
+ <executions>
139
+ <execution>
140
+ <id>sign-artifacts</id>
141
+ <phase>verify</phase>
142
+ <goals>
143
+ <goal>sign</goal>
144
+ </goals>
145
+ </execution>
146
+ </executions>
147
+ </plugin>
148
+ </plugins>
149
+ </build>
150
+ </profile>
151
+ </profiles>
152
+
153
+ </project>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+ <project>
19
+ <modelVersion>4.0.0</modelVersion>
20
+ <groupId>org.apache.tomcat</groupId>
21
+ <artifactId>tomcat</artifactId>
22
+ <version>7.0.40</version>
23
+ <description>Binary distribution of Apache Tomcat</description>
24
+ <url>http://tomcat.apache.org/</url>
25
+ <packaging>pom</packaging>
26
+ <licenses>
27
+ <license>
28
+ <name>Apache License, Version 2.0</name>
29
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
30
+ <distribution>repo</distribution>
31
+ </license>
32
+ </licenses>
33
+ </project>
@@ -0,0 +1,80 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe PomGetter do
6
+ describe ".get_pom" do
7
+ it "gets the pom from a directory" do
8
+ dir_path = File.join("spec", "data", "commons-logging")
9
+ pom_path = File.join(dir_path, "pom.xml")
10
+ PomGetter.get_pom(dir_path).should eq(File.read(pom_path))
11
+ end
12
+
13
+ it "gets the pom from a jar" do
14
+ dir_path = File.join("spec", "data", "commons-logging")
15
+ pom_path = File.join(dir_path, "pom.xml")
16
+ jar_path = File.join(dir_path, "commons-logging-1.1.1.jar")
17
+ PomGetter.get_pom(jar_path).should eq(File.read(pom_path))
18
+ end
19
+
20
+ it "gets the pom from sha1" do
21
+ dir_path = File.join("spec", "data", "antlr")
22
+ pom_path = File.join(dir_path, "pom.xml")
23
+ jar_path = File.join(dir_path, "antlr-2.7.2.jar")
24
+ PomGetter.get_pom(jar_path).should eq(File.read(pom_path))
25
+ end
26
+
27
+ it "gets the pom from a heuristic" do
28
+ dir_path = File.join("spec", "data", "nailgun")
29
+ pom_path = File.join(dir_path, "pom.xml")
30
+ jar_path = File.join(dir_path, "nailgun-0.7.1.jar")
31
+ PomGetter.get_pom(jar_path).should eq(File.read(pom_path))
32
+ end
33
+
34
+ it "computes chunk distances" do
35
+ PomGetter.chunk_distance(nil, "1").should eq(1)
36
+ PomGetter.chunk_distance("alpha", nil).should eq(5)
37
+
38
+ PomGetter.chunk_distance("1", "1").should eq(0)
39
+ PomGetter.chunk_distance("1", "9").should eq(8)
40
+ PomGetter.chunk_distance("1", "999").should eq(99)
41
+
42
+ PomGetter.chunk_distance("snap", "SNAP").should eq(0)
43
+ PomGetter.chunk_distance("snap", "snippete").should eq(5)
44
+ PomGetter.chunk_distance("snap", "l"*999).should eq(99)
45
+
46
+ PomGetter.chunk_distance("1", "SNAP").should eq(4)
47
+
48
+ PomGetter.chunk_distance("0", "10").should eq(10)
49
+ PomGetter.chunk_distance("0", "9").should eq(9)
50
+ end
51
+
52
+ it "finds the best match" do
53
+ my_version = "1.0"
54
+ available_versions = ["1.0", "1", "2.0", "1.0.1", "4.5.6.7.8"]
55
+ PomGetter.best_match(my_version, available_versions).should eq("1.0")
56
+
57
+ available_versions = ["3.0", "2.0", "1.0.1"]
58
+ PomGetter.best_match(my_version, available_versions).should eq("1.0.1")
59
+
60
+ available_versions = ["1.snap", "2.0", "4.0.1"]
61
+ PomGetter.best_match(my_version, available_versions).should eq("1.snap")
62
+
63
+ available_versions = ["1.10", "1.9", "2.0", "3.0.1"]
64
+ PomGetter.best_match(my_version, available_versions).should eq("1.9")
65
+
66
+ my_version = "1.snap"
67
+ available_versions = ["1.snap", "1"]
68
+ PomGetter.best_match(my_version, available_versions).should eq("1.snap")
69
+
70
+ my_version = "1.very-very_very_longish"
71
+ available_versions = ["1.snap", "1"]
72
+ PomGetter.best_match(my_version, available_versions).should eq("1.snap")
73
+
74
+ my_version = "1.snap"
75
+ available_versions = []
76
+ PomGetter.best_match(my_version, available_versions).should be_nil
77
+ end
78
+ end
79
+ end
80
+
@@ -0,0 +1,18 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe SourceAddressGetter do
6
+ describe ".get_source_address" do
7
+ it "gets the source address from a pom file" do
8
+ pom_path = File.join("spec", "data", "commons-logging", "pom.xml")
9
+ SourceAddressGetter.get_source_address(pom_path).should eq "svn:http://svn.apache.org/repos/asf/commons/proper/logging/tags/commons-logging-1.1.1"
10
+ end
11
+
12
+ it "gets the source address from Github" do
13
+ pom_path = File.join("spec", "data", "antlr", "pom.xml")
14
+ SourceAddressGetter.get_source_address(pom_path).should eq "git:https://github.com/antlr/antlr4"
15
+ end
16
+ end
17
+ end
18
+
@@ -0,0 +1,23 @@
1
+ # encoding: UTF-8
2
+
3
+ require "spec_helper"
4
+ require "fileutils"
5
+
6
+ describe SourceGetter do
7
+ describe ".get_source_from_git" do
8
+ it "gets the sources from a git repo" do
9
+
10
+ dir_path = File.join("spec", "data", "tomcat")
11
+ pom_path = File.join(dir_path, "pom.xml")
12
+
13
+ SourceGetter.get_source("git:https://github.com/apache/tomcat", pom_path, dir_path)
14
+
15
+ repo_path = File.join(dir_path, "org.apache.tomcat:tomcat:7.0.40")
16
+ file_path = File.join(repo_path, "LICENSE")
17
+ File.open(file_path).readline.should eq "\n"
18
+
19
+ FileUtils.rm_rf(repo_path)
20
+ end
21
+ end
22
+ end
23
+
@@ -0,0 +1,32 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Pom do
6
+ let(:pom) { Pom.new(File.join("spec", "data", "commons-logging", "pom.xml")) }
7
+
8
+ describe "#connection_address" do
9
+ it "reads the SCM connection address" do
10
+ pom.connection_address.should eq "svn:http://svn.apache.org/repos/asf/commons/proper/logging/tags/commons-logging-1.1.1"
11
+ end
12
+ end
13
+
14
+ describe "#group_id" do
15
+ it "reads the group id" do
16
+ pom.group_id.should eq "commons-logging"
17
+ end
18
+ end
19
+
20
+ describe "#artifact_id" do
21
+ it "reads the artifact id" do
22
+ pom.artifact_id.should eq "commons-logging"
23
+ end
24
+ end
25
+
26
+ describe "#version" do
27
+ it "reads the version" do
28
+ pom.version.should eq "1.1.1"
29
+ end
30
+ end
31
+ end
32
+
@@ -0,0 +1,6 @@
1
+ # encoding: UTF-8
2
+
3
+ require "gjp"
4
+ require "logger"
5
+
6
+ init_logger(Logger::INFO)
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gjp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Silvio Moioli
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: clamp
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rubyzip
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rest-client
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: json
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: text
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: nokogiri
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ description: A suite of tools to ease Java packaging in SUSE systems
143
+ email:
144
+ - smoioli@suse.de
145
+ executables:
146
+ - gjp
147
+ extensions: []
148
+ extra_rdoc_files: []
149
+ files:
150
+ - .gitignore
151
+ - Gemfile
152
+ - Gemfile.lock
153
+ - README.md
154
+ - Rakefile
155
+ - bin/gjp
156
+ - gjp.gemspec
157
+ - lib/gjp.rb
158
+ - lib/gjp/cli.rb
159
+ - lib/gjp/get_pom.rb
160
+ - lib/gjp/get_source.rb
161
+ - lib/gjp/get_source_address.rb
162
+ - lib/gjp/logger.rb
163
+ - lib/gjp/pom.rb
164
+ - lib/gjp/version.rb
165
+ - spec/data/antlr/antlr-2.7.2.jar
166
+ - spec/data/antlr/pom.xml
167
+ - spec/data/commons-logging/commons-logging-1.1.1.jar
168
+ - spec/data/commons-logging/pom.xml
169
+ - spec/data/nailgun/nailgun-0.7.1.jar
170
+ - spec/data/nailgun/pom.xml
171
+ - spec/data/tomcat/pom.xml
172
+ - spec/lib/get_pom_spec.rb
173
+ - spec/lib/get_source_address_spec.rb
174
+ - spec/lib/get_source_spec.rb
175
+ - spec/lib/pom_spec.rb
176
+ - spec/spec_helper.rb
177
+ homepage: https://github.com/SilvioMoioli/gjp
178
+ licenses: []
179
+ post_install_message:
180
+ rdoc_options: []
181
+ require_paths:
182
+ - lib
183
+ required_ruby_version: !ruby/object:Gem::Requirement
184
+ none: false
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ required_rubygems_version: !ruby/object:Gem::Requirement
190
+ none: false
191
+ requirements:
192
+ - - ! '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ requirements: []
196
+ rubyforge_project: gjp
197
+ rubygems_version: 1.8.23
198
+ signing_key:
199
+ specification_version: 3
200
+ summary: Green Java Packager's Tools
201
+ test_files:
202
+ - spec/data/antlr/antlr-2.7.2.jar
203
+ - spec/data/antlr/pom.xml
204
+ - spec/data/commons-logging/commons-logging-1.1.1.jar
205
+ - spec/data/commons-logging/pom.xml
206
+ - spec/data/nailgun/nailgun-0.7.1.jar
207
+ - spec/data/nailgun/pom.xml
208
+ - spec/data/tomcat/pom.xml
209
+ - spec/lib/get_pom_spec.rb
210
+ - spec/lib/get_source_address_spec.rb
211
+ - spec/lib/get_source_spec.rb
212
+ - spec/lib/pom_spec.rb
213
+ - spec/spec_helper.rb