Skip to content

Commit

Permalink
Develop (#9)
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cwisniew authored Sep 30, 2019
2 parents 8390ceb + 0aabb6a commit c6caaa8
Show file tree
Hide file tree
Showing 37 changed files with 1,780 additions and 1,514 deletions.
24 changes: 17 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.gradle
build/
maven-repo/

# OS generated files
################################################################################
.DS_Store
Expand All @@ -16,11 +12,21 @@ Thumbs.db

# Others
################################################################################
*.log
*~
target/
.gradle
build/
/bin/
target/
out/
/releases/
*.log
*~
\${sys:appHome}/


# Automatically Generated
################################################################################
package/windows/MapTool.iss
src/main/resources/sentry.properties


# IDEs
Expand All @@ -33,3 +39,7 @@ out/
.settings/
.classpath
.history
workbench.xmi

# Keystore
build-resources/rptools-keystore
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![](https://jitpack.io/v/RPTools/dicelib.svg)](https://jitpack.io/#RPTools/dicelib)

# dicelib
Dice Roll Library used by RPTools programs.

163 changes: 75 additions & 88 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,97 @@
import org.apache.tools.ant.filters.ReplaceTokens
import java.text.SimpleDateFormat
import org.ajoberstar.grgit.*

buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.13.0"
}

repositories {
mavenCentral()
}
}

// Access Git info from build script
plugins {
id "org.ajoberstar.grgit" version "3.0.0"
}

apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'application'
apply plugin: 'maven'

apply plugin: 'java-library'
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'maven'



sourceCompatibility = 10
targetCompatibility = 10


// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
mavenLocal()
maven { url = 'http://maptool.craigs-stuff.net/repo/' }
maven { url = 'https://jitpack.io' }
}


sourceCompatibility = 1.7
targetCompatibility = 1.7

if (version == 'unspecified') {
version = getVersionName()
dependencies {
compile 'rhino:js:1.6R5'
compile 'antlr:antlr:2.7.6'
// compile 'net.rptools.parser:parser:1.1.b24'
implementation 'com.github.RPTools:parser:1.5.5'
testCompile group: 'junit', name: 'junit', version: '4.11'
}

ext.repo = Grgit.open(project.file('.'))
// Custom properties
ext {
// Get tag and commit info from Git to use for version numbering
def repo = org.ajoberstar.grgit.Grgit.open(currentDir: file('.'))
def head = repo.head()
def tags = repo.tag.list().find {
it.commit == head
}

if (tags) {
tagVersion = tags.getName()
project.version = tagVersion
}

revision = head.abbreviatedId
revisionFull = head.id

// println 'Configuring for ' + project.name + " " + tagVersion + " by " + vendor
}
group = "net.rptools.dicelib"

spotless {
java {
eclipseFormatFile 'build-resources/eclipse.prefs.formatter.xml'
licenseHeaderFile 'spotless.license.java'
// Now using the Google Java style guide
//eclipse().configFile('build-resources/eclipse.prefs.formatter.xml')
googleJavaFormat()
// If you get exceptions thrown by spotlessApply, this might
// help. Enable it here if the problem is with a Java file, and
// below if it is not. Don't leave it enabled, as nothing will
// actually be updated if you do.
// https://github.com/diffplug/spotless/blob/master/PADDEDCELL.md
//paddedCell()
}
}

format 'misc', {
target '**/*.gradle', '**/.gitignore'

configurations {
deployerJars
// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
//paddedCell()
}
}


task wrapper(type: Wrapper) {
gradleVersion='2.1'
configurations {
deployerJars
}

install {
Expand All @@ -57,75 +113,6 @@ uploadArchives {
}
}

buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'org.ajoberstar:gradle-git:0.11.2'
classpath 'com.diffplug.gradle.spotless:spotless:1.3.0-SNAPSHOT'
}
}


dependencies {
compile 'rhino:js:1.6R5'
compile 'antlr:antlr:2.7.6'
compile 'net.rptools.parser:parser:1.1.b24'
testCompile group: 'junit', name: 'junit', version: '4.11'
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}

ext.compileDate = new Date();
ext.yyyymmdd = (new SimpleDateFormat('yyyyMMDD')).format(ext.compileDate);


repositories {
mavenCentral()
mavenLocal()
maven {
url = 'http://maptool.craigs-stuff.net/repo/'
}
}


/*
* Gets the version name from the latest Git tag
*/

def getVersionName() {


if (project.hasProperty('buildVersion')) {
return buildVersion
} else {
String vtxtVersionNo = new File('build-resources/version.txt').text.trim()

return vtxtVersionNo
}
}

findbugs {
ignoreFailures = true
toolVersion = '3.0.0'
effort = 'max'
sourceSets = [] // Empty source set so it wont run during build/check
}

pmd {
ignoreFailures = true
sourceSets = [] // Empty source set so it wont run during tebuild/check
}



task showBuildVersion() << {
println 'Build Version Number = ' + project.version
}

jar {
manifest {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
100755 → 100644
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun May 03 01:01:06 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
78 changes: 43 additions & 35 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

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

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

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

0 comments on commit c6caaa8

Please sign in to comment.