Skip to content

Commit 49f17b6

Browse files
committed
Update gradle settings, add lint, fix groupid.
1 parent b5d697a commit 49f17b6

File tree

6 files changed

+128
-102
lines changed

6 files changed

+128
-102
lines changed

build.gradle

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ apply(plugin: "eclipse");
5252

5353
apply(from: "project.gradle");
5454

55+
group = "com.github.java-json-tools";
56+
5557
/*
5658
* Repositories to use
5759
*/
@@ -79,6 +81,17 @@ task sourcesJar(type: Jar, dependsOn: classes) {
7981
from sourceSets.main.allSource;
8082
}
8183

84+
/*
85+
* Lint all the things!
86+
*/
87+
allprojects {
88+
gradle.projectsEvaluated {
89+
tasks.withType(JavaCompile) {
90+
options.compilerArgs << "-Xlint:all"
91+
}
92+
}
93+
}
94+
8295
/*
8396
* Javadoc: we need to tell where the overview.html is, it will not pick it up
8497
* automatically...
@@ -99,39 +112,43 @@ artifacts {
99112
archives javadocJar;
100113
}
101114

102-
task wrapper(type: Wrapper) {
103-
gradleVersion = "1.11";
115+
wrapper {
116+
gradleVersion = "5.6.2";
104117
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip";
105118
}
106119

107-
task pom << {
108-
pom {}.writeTo("${projectDir}/pom.xml");
120+
task pom {
121+
doLast {
122+
pom {}.writeTo("${projectDir}/pom.xml");
123+
}
109124
}
110125

111126
/*
112127
* SIGNING
113128
*/
114129

115130
project.ext {
116-
gitrwscm = sprintf("[email protected]:fge/%s", name);
117-
gitroscm = sprintf("https://github.com/fge/%s.git", name);
118-
projectURL = sprintf("https://github.com/fge/%s", name);
131+
description = "A lightweight, UTF-8 capable, printf() capable alternative to Java's ResourceBundle";
132+
scmUrl = sprintf("git@github.com:java-json-tools/%s.git", name)
133+
projectURL = sprintf("https://github.com/java-json-tools/%s", name);
119134
sonatypeStaging = "https://oss.sonatype.org/service/local/staging/deploy/maven2/";
120135
sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots/";
121136
};
122137

123-
task checkSigningRequirements << {
124-
def requiredProperties = [ "sonatypeUsername", "sonatypePassword" ];
125-
def noDice = false;
126-
requiredProperties.each {
127-
if (project.properties[it] == null) {
128-
noDice = true;
129-
System.err.printf("property \"%s\" is not defined!")
138+
task checkSigningRequirements {
139+
doLast {
140+
def requiredProperties = [ "sonatypeUsername", "sonatypePassword" ];
141+
def noDice = false;
142+
requiredProperties.each {
143+
if (project.properties[it] == null) {
144+
noDice = true;
145+
System.err.printf("property \"%s\" is not defined!")
146+
}
130147
}
148+
if (noDice)
149+
throw new IllegalStateException("missing required properties for " +
150+
"upload");
131151
}
132-
if (noDice)
133-
throw new IllegalStateException("missing required properties for " +
134-
"upload");
135152
}
136153

137154
uploadArchives {
@@ -167,15 +184,15 @@ uploadArchives {
167184
uploadArchives.repositories.mavenDeployer
168185
]*.pom*.whenConfigured { pom ->
169186
pom.project {
170-
name "${name}";
187+
name "${project.name}";
171188
packaging "jar";
172-
description "${description}";
189+
description "${project.ext.description}";
173190
url "${projectURL}";
174191

175192
scm {
176-
url "${gitrwscm}";
177-
connection "${gitrwscm}";
178-
developerConnection "${gitroscm}";
193+
url "${scmUrl}";
194+
connection "${scmUrl}";
195+
developerConnection "scm:git:${scmUrl}";
179196
}
180197

181198
licenses {
@@ -193,9 +210,9 @@ uploadArchives {
193210

194211
developers {
195212
developer {
196-
id "fge";
197-
name "Francis Galiegue";
198-
email "fgaliegue@gmail.com";
213+
id "huggsboson";
214+
name "John Huffaker";
215+
email "jhuffaker+java-json-tools@gmail.com";
199216
}
200217
}
201218
}

gradle/wrapper/gradle-wrapper.jar

4.4 KB
Binary file not shown.
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
1-
#
2-
# Copyright (c) 2014, Francis Galiegue ([email protected])
3-
#
4-
# This software is dual-licensed under:
5-
#
6-
# - the Lesser General Public License (LGPL) version 3.0 or, at your option, any
7-
# later version;
8-
# - the Apache Software License (ASL) version 2.0.
9-
#
10-
# The text of this file and of both licenses is available at the root of this
11-
# project or, if you have the jar distribution, in directory META-INF/, under
12-
# the names LGPL-3.0.txt and ASL-2.0.txt respectively.
13-
#
14-
# Direct link to the sources:
15-
#
16-
# - LGPL 3.0: https://www.gnu.org/licenses/lgpl-3.0.txt
17-
# - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
18-
#
19-
20-
#Sat Apr 12 21:17:48 CEST 2014
211
distributionBase=GRADLE_USER_HOME
222
distributionPath=wrapper/dists
3+
distributionUrl=http\://services.gradle.org/distributions/gradle-5.6.2-all.zip
234
zipStoreBase=GRADLE_USER_HOME
245
zipStorePath=wrapper/dists
25-
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip

gradlew

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://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+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,31 +75,11 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6883
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6984

7085
# Determine the Java command to use to start the JVM.
@@ -90,7 +105,7 @@ location of your Java installation."
90105
fi
91106

92107
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
108+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
94109
MAX_FD_LIMIT=`ulimit -H -n`
95110
if [ $? -eq 0 ] ; then
96111
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,10 +125,11 @@ if $darwin; then
110125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111126
fi
112127

113-
# For Cygwin, switch paths to Windows format before running java
114-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
115130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132+
JAVACMD=`cygpath --unix "$JAVACMD"`
117133

118134
# We build the pattern for arguments to be converted via cygpath
119135
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +170,19 @@ if $cygwin ; then
154170
esac
155171
fi
156172

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=("$@")
173+
# Escape application args
174+
save () {
175+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176+
echo " "
160177
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
178+
APP_ARGS=$(save "$@")
179+
180+
# Collect all arguments for the java command, following the shell quoting and substitution rules
181+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182+
183+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185+
cd "$(dirname "$0")"
186+
fi
163187

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
188+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -8,14 +24,14 @@
824
@rem Set local scope for the variables with windows NT shell
925
if "%OS%"=="Windows_NT" setlocal
1026

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1427
set DIRNAME=%~dp0
1528
if "%DIRNAME%" == "" set DIRNAME=.
1629
set APP_BASE_NAME=%~n0
1730
set APP_HOME=%DIRNAME%
1831

32+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34+
1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
2137

@@ -46,10 +62,9 @@ echo location of your Java installation.
4662
goto fail
4763

4864
:init
49-
@rem Get command-line arguments, handling Windowz variants
65+
@rem Get command-line arguments, handling Windows variants
5066

5167
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5368

5469
:win9xME_args
5570
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
6075
if "x%~1" == "x" goto execute
6176

6277
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6878

6979
:execute
7080
@rem Setup the command line

project.gradle

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@
2020
/*
2121
* Project-specific settings. Unfortunately we cannot put the name in there!
2222
*/
23-
group = "com.github.fge";
24-
version = "1.2-SNAPSHOT";
25-
sourceCompatibility = "1.6";
26-
targetCompatibility = "1.6"; // defaults to sourceCompatibility
27-
28-
project.ext {
29-
description = "A lightweight, fully compatible, UTF-8/printf() capable alternative to Java's ResourceBundle";
30-
};
23+
group = "com.github.java-json-tools";version = "1.2-SNAPSHOT";
24+
sourceCompatibility = JavaVersion.VERSION_1_6;
25+
targetCompatibility = JavaVersion.VERSION_1_6; // defaults to sourceCompatibility
3126

3227
/*
3328
* List of dependencies
@@ -45,6 +40,6 @@ dependencies {
4540
}
4641

4742
javadoc.options.links("http://docs.oracle.com/javase/6/docs/api/");
48-
javadoc.options.links("http://jsr-305.googlecode.com/svn/trunk/javadoc/");
43+
javadoc.options.links("http://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.1/");
4944
javadoc.options.links("http://fge.github.io/btf/");
5045

0 commit comments

Comments
 (0)