forked from braintree/braintree_java
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
59 lines (49 loc) · 1.27 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ENV['TEST_JDK_VERSION'] ||= "1.5"
mvn = "MAVEN_OPTS='-Dhttps.protocols=TLSv1.2' mvn"
task :default => :jar
task :clean do
sh "#{mvn} clean"
sh "rm *jar || true"
sh "rm -rf doc"
end
task :compile do
sh "#{mvn} compile"
end
namespace :test do
desc "run unit tests"
task :unit do
sh "#{mvn} verify -DskipITs"
end
desc "run unit and integration tests"
task :all do
sh "#{mvn} verify"
end
end
task :test => "test:all"
desc "compile, test, build a jar"
task :jar do
sh "#{mvn} verify package"
sh "cp target/braintree-java-*.jar ./"
end
# e.g. rake single_test testclass=com.braintreegateway.integrationtest.TransactionIT
# OR rake single_test testclass=com.braintreegateway.integrationtest.TransactionIT#sale_is_success
desc "run a single unit or integration test class"
task :single_test do
test_class = ENV['testclass']
if test_class.include? ".integrationtest."
sh "#{mvn} verify -Dit.test=#{test_class}"
else
sh "#{mvn} test -Dtest=#{test_class}"
end
end
desc "generate javadoc"
task :javadoc do
excludes = [
"com.braintreegateway.util",
"com.braintreegateway.org"
]
sh "javadoc -sourcepath src/main/java -subpackages com.braintreegateway -exclude #{excludes.join(":")} -d doc"
end
def jar_name
"braintree-java-#{version}.jar"
end