Skip to content

Commit 08de642

Browse files
other boiler-plate code
1 parent 4c7a16b commit 08de642

File tree

11 files changed

+449
-0
lines changed

11 files changed

+449
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CHANGELOG
2+
=========
3+
4+
v1.0.0 (April 31, 2017)
5+
-----------------------
6+
* Initial Release.
7+
8+

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contribute to the PayU Java SDK
2+
3+
### *Pull requests are welcome!*
4+
5+
Developer Setup
6+
------------------
7+
- We are using [Lombok Plugin](https://projectlombok.org/download.html) to auto generate getters and setters for our API model objects.
8+
- To properly help you contribute, you need to follow instructions on setting up Lombok Plugin in your IDE (Eclipse/IntelliJ/etc), as [shown here](https://projectlombok.org/download.html).
9+
10+
General Guidelines
11+
------------------
12+
13+
* **Code style.** Please follow local code style. Ask if you're unsure.
14+
* **No warnings.** All generated code must compile without warnings.

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'releasinator', '~> 0.6'

README.md

Whitespace-only changes.

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spec = Gem::Specification.find_by_name 'releasinator'
2+
load "#{spec.gem_dir}/lib/tasks/releasinator.rake"

build.gradle

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
7+
}
8+
}
9+
apply plugin: 'io.codearte.nexus-staging'
10+
11+
allprojects {
12+
apply plugin: 'maven'
13+
apply plugin: 'java'
14+
15+
group = 'co.za.payu.sdk'
16+
version = '0.1.0'
17+
sourceCompatibility = 1.6
18+
targetCompatibility = 1.6
19+
20+
repositories {
21+
mavenCentral()
22+
}
23+
// Currently disables doclint
24+
tasks.withType(Javadoc) {
25+
options.addStringOption('Xdoclint:none', '-quiet')
26+
}
27+
28+
}
29+
30+
// GLOBAL METHODS
31+
def getRepositoryUsername() {
32+
return hasProperty('sonatypeUsername') ? sonatypeUsername : ""
33+
}
34+
35+
def getRepositoryPassword() {
36+
return hasProperty('sonatypePassword') ? sonatypePassword : ""
37+
}
38+
39+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
40+
41+
// ## REST API SDK
42+
project(':payu-mea-java-sdk') {
43+
apply plugin: 'signing'
44+
45+
apply from: 'lombok.gradle'
46+
47+
nexusStaging {
48+
packageGroup = "co.za.payu"
49+
username = getRepositoryUsername()
50+
password = getRepositoryPassword()
51+
}
52+
53+
dependencies {
54+
// General
55+
compile 'com.google.code.gson:gson:2.2.2'
56+
57+
// Logging
58+
testRuntime 'org.apache.logging.log4j:log4j-api:2.1'
59+
testRuntime 'org.apache.logging.log4j:log4j-core:2.1'
60+
testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.1'
61+
compile 'org.slf4j:slf4j-api:1.7.21'
62+
63+
// Test
64+
testCompile 'org.testng:testng:6.3.1'
65+
testCompile "org.mockito:mockito-core:[2.0,)"
66+
}
67+
68+
test {
69+
// enable TestNG support (default is JUnit)
70+
useTestNG {
71+
suites 'src/test/resources/testng.xml'
72+
// show standard out and standard error of the test JVM(s) on the console
73+
testLogging.showStandardStreams = true
74+
// This is to force the test task to execute everytime.
75+
outputs.upToDateWhen { false }
76+
}
77+
}
78+
79+
// Run functional tests
80+
task functionalTest(type: Test, dependsOn: 'test') {
81+
useTestNG() {
82+
suites 'src/test/resources/functional.xml'
83+
}
84+
}
85+
86+
task sourcesJar(type: Jar, dependsOn: classes) {
87+
classifier = 'sources'
88+
// Using delomboked as a source
89+
from sourceSets.main.ext.delombok
90+
}
91+
92+
task javadocJar(type: Jar, dependsOn: javadoc) {
93+
classifier = 'javadoc'
94+
from javadoc.destinationDir
95+
}
96+
97+
artifacts {
98+
archives sourcesJar
99+
archives javadocJar
100+
}
101+
102+
uploadArchives {
103+
repositories.mavenDeployer {
104+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
105+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
106+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
107+
}
108+
109+
pom.project {
110+
name 'payu-mea-java-sdk'
111+
groupId 'co.za.payu.sdk'
112+
artifactId 'payu-mea-java-sdk'
113+
packaging 'jar'
114+
description 'PayU Java SDK for integrating with the SOAP APIs'
115+
url 'https://github.com/netcraft-devops/payu-mea-java-sdk.git'
116+
117+
scm {
118+
url 'https://github.com/netcraft-devops/payu-mea-java-sdk.git'
119+
connection 'scm:git:git://github.com/netcraft-devops/payu-mea-java-sdk.git'
120+
}
121+
122+
licenses {
123+
license {
124+
name 'MIT License'
125+
url 'https://github.com/netcraft-devops/payu-mea-java-sdk/blob/master/LICENSE.txt'
126+
distribution 'repo'
127+
}
128+
}
129+
130+
developers {
131+
developer {
132+
id 'onahkenneth'
133+
name 'Kenneth Onah'
134+
email 'kenneth@netcraft-devops.com'
135+
}
136+
}
137+
}
138+
}
139+
}
140+
141+
signing {
142+
required { isReleaseVersion && gradle.taskGraph.hasTask(tasks.uploadArchives) }
143+
sign configurations.archives
144+
}
145+
}
146+
147+
// ## REST API SAMPLE PROJECT
148+
project(':payu-mea-java-sample') {
149+
apply plugin: 'jetty'
150+
151+
dependencies {
152+
compile project(':payu-mea-java-sdk')
153+
compile 'javax.servlet:javax.servlet-api:3.1.0'
154+
compile 'log4j:log4j:1.2.14'
155+
compile 'org.apache.logging.log4j:log4j-api:2.1'
156+
compile 'org.apache.logging.log4j:log4j-core:2.1'
157+
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.1'
158+
}
159+
}

gradle/wrapper/gradle-wrapper.jar

52.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue Apr 25 20:31:08 SAST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip

gradlew

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env bash
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
26+
27+
APP_NAME="Gradle"
28+
APP_BASE_NAME=`basename "$0"`
29+
30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
33+
# Use the maximum available, or set MAX_FD != -1 to use that value.
34+
MAX_FD="maximum"
35+
36+
warn ( ) {
37+
echo "$*"
38+
}
39+
40+
die ( ) {
41+
echo
42+
echo "$*"
43+
echo
44+
exit 1
45+
}
46+
47+
# OS specific support (must be 'true' or 'false').
48+
cygwin=false
49+
msys=false
50+
darwin=false
51+
nonstop=false
52+
case "`uname`" in
53+
CYGWIN* )
54+
cygwin=true
55+
;;
56+
Darwin* )
57+
darwin=true
58+
;;
59+
MINGW* )
60+
msys=true
61+
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
65+
esac
66+
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68+
69+
# Determine the Java command to use to start the JVM.
70+
if [ -n "$JAVA_HOME" ] ; then
71+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72+
# IBM's JDK on AIX uses strange locations for the executables
73+
JAVACMD="$JAVA_HOME/jre/sh/java"
74+
else
75+
JAVACMD="$JAVA_HOME/bin/java"
76+
fi
77+
if [ ! -x "$JAVACMD" ] ; then
78+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79+
80+
Please set the JAVA_HOME variable in your environment to match the
81+
location of your Java installation."
82+
fi
83+
else
84+
JAVACMD="java"
85+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86+
87+
Please set the JAVA_HOME variable in your environment to match the
88+
location of your Java installation."
89+
fi
90+
91+
# Increase the maximum file descriptors if we can.
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93+
MAX_FD_LIMIT=`ulimit -H -n`
94+
if [ $? -eq 0 ] ; then
95+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96+
MAX_FD="$MAX_FD_LIMIT"
97+
fi
98+
ulimit -n $MAX_FD
99+
if [ $? -ne 0 ] ; then
100+
warn "Could not set maximum file descriptor limit: $MAX_FD"
101+
fi
102+
else
103+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104+
fi
105+
fi
106+
107+
# For Darwin, add options to specify how the application appears in the dock
108+
if $darwin; then
109+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110+
fi
111+
112+
# For Cygwin, switch paths to Windows format before running java
113+
if $cygwin ; then
114+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117+
118+
# We build the pattern for arguments to be converted via cygpath
119+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120+
SEP=""
121+
for dir in $ROOTDIRSRAW ; do
122+
ROOTDIRS="$ROOTDIRS$SEP$dir"
123+
SEP="|"
124+
done
125+
OURCYGPATTERN="(^($ROOTDIRS))"
126+
# Add a user-defined pattern to the cygpath arguments
127+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129+
fi
130+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
131+
i=0
132+
for arg in "$@" ; do
133+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135+
136+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138+
else
139+
eval `echo args$i`="\"$arg\""
140+
fi
141+
i=$((i+1))
142+
done
143+
case $i in
144+
(0) set -- ;;
145+
(1) set -- "$args0" ;;
146+
(2) set -- "$args0" "$args1" ;;
147+
(3) set -- "$args0" "$args1" "$args2" ;;
148+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154+
esac
155+
fi
156+
157+
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158+
function splitJvmOpts() {
159+
JVM_OPTS=("$@")
160+
}
161+
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162+
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163+
164+
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

0 commit comments

Comments
 (0)