Skip to content

Commit

Permalink
Gradle task sends output to info log. Merge misc. fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
double16 committed Dec 12, 2016
1 parent 4eb3d69 commit 02342d9
Show file tree
Hide file tree
Showing 48 changed files with 478 additions and 3,800 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ Thumbs.db
build-plugin.gradle
build-doc.txt
.sonar
/.nb-gradle/
build/
/.nb-gradle/
setenv.sh
23 changes: 20 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ buildscript {


plugins {
id 'com.gradle.build-scan' version '1.0'
id 'org.asciidoctor.convert' version '1.5.2'
id "org.sonarqube" version "1.0"
}

group = 'org.aim42'


buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}

ext {
srcDir = "$projectDir/src/docs"
Expand All @@ -50,6 +54,7 @@ apply plugin: "com.gradle.plugin-publish"

// publish to (local) maven repo
apply plugin: 'maven-publish'
apply from: "config/publish-snapshot.gradle"

// determine test coverate
apply from: "config/coverage.gradle"
Expand Down Expand Up @@ -140,7 +145,7 @@ asciidoctor {

// ==========================================================
// if you use htmlSanityCheck locally, publish with
// "gradle uploadToLocalMaven
// "gradle publishToMavenLocal"


publishing {
Expand All @@ -166,7 +171,7 @@ apply from: 'config/publish-gradle-plugin.gradle'
// =========================================================
task info(
description: "info on path and objects"
) <<
) { doLast
{
println "project.name : " + project.name
println "version : " + version
Expand All @@ -178,7 +183,19 @@ task info(
println "targetCompatibility : " + rootProject.targetCompatibility
println "="*80
}
}

task primeCache {
group = "staging"
doLast {
project.rootProject.allprojects.each { subProject ->
logger.info "Priming ${subProject.name}, configs = ${subProject.buildscript.configurations*.name}"
subProject.buildscript.configurations*.resolve()
logger.info "Priming ${subProject.name}, configs = ${subProject.configurations*.name}"
subProject.configurations*.resolve()
}
}
}

/*
* Copyright 2012-2015 the original author or authors.
Expand Down
627 changes: 0 additions & 627 deletions build/html5/DevelopmentGuide.html

This file was deleted.

2,393 changes: 0 additions & 2,393 deletions build/html5/hsc_arc42.html

This file was deleted.

Binary file removed build/html5/images/Building-Block-Hierarchy.png
Binary file not shown.
Binary file removed build/html5/images/Checker-Whitebox.png
Binary file not shown.
Binary file removed build/html5/images/HTML_Checking_Domain.png
Binary file not shown.
Binary file removed build/html5/images/HTML_Checking_Domain_compact.png
Binary file not shown.
Binary file removed build/html5/images/Reporter Whitebox.png
Binary file not shown.
Binary file removed build/html5/images/ResultsCollector.png
Binary file not shown.
Binary file removed build/html5/images/arc42-logo.png
Binary file not shown.
Binary file removed build/html5/images/deployment-context-gradle.png
Binary file not shown.
Binary file removed build/html5/images/deployment-context-installer.png
Binary file not shown.
Binary file removed build/html5/images/deployment-context.png
Binary file not shown.
Binary file removed build/html5/images/hsc-context.png
Binary file not shown.
Binary file removed build/html5/images/hsc-core.png
Binary file not shown.
Binary file removed build/html5/images/hsc-deployment.png
Binary file not shown.
Binary file removed build/html5/images/hsc-whitebox.png
Binary file not shown.
Binary file removed build/html5/images/htmlsanitycheck-logo.png
Binary file not shown.
Binary file removed build/html5/images/htmlsanitycheck-overview.png
Binary file not shown.
Binary file removed build/html5/images/intellij-run-configuration.jpg
Binary file not shown.
Binary file removed build/html5/images/perform-all-checks.png
Binary file not shown.
Binary file removed build/html5/images/reportFindings.png
Binary file not shown.
Binary file removed build/html5/images/sample-hsc-report.jpg
Binary file not shown.
Binary file removed build/html5/images/template-method.png
Binary file not shown.
Binary file removed build/html5/images/uri-generic-example.png
Binary file not shown.
599 changes: 0 additions & 599 deletions build/html5/index.html

This file was deleted.

42 changes: 22 additions & 20 deletions config/gmetrics.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
configurations {
gmetrics
group = 'Reporting'
}

dependencies {
gmetrics 'org.gmetrics:GMetrics:0.7'
}

task gmetrics << {
//use GMetrics ant task - http://gmetrics.sourceforge.net/gmetrics-ant-task.html
ant.taskdef(name: 'gmetrics', classname: 'org.gmetrics.ant.GMetricsTask', classpath: configurations.gmetrics.asPath)
task gmetrics {
group = 'Reporting'
doLast {
//use GMetrics ant task - http://gmetrics.sourceforge.net/gmetrics-ant-task.html
ant.taskdef(name: 'gmetrics', classname: 'org.gmetrics.ant.GMetricsTask', classpath: configurations.gmetrics.asPath)

logging.captureStandardOutput(LogLevel.INFO);
logging.captureStandardOutput(LogLevel.INFO);

//ensure reporting directory created
ant.mkdir(dir: "${project.reporting.baseDir.path}/gmetrics")
ant.gmetrics(metricSetFile: 'file:gradle/gmetrics-metricset.groovy') {
report(type: 'org.gmetrics.report.BasicHtmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.html")
}
report(type: 'org.gmetrics.report.XmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.xml")
}
fileset(dir: 'src') {
include(name: '**/*.groovy')
//exclusions to filter out any classes with inner classes - sonar doesn't support
exclude(name: '**/*Config*')
}
}
//ensure reporting directory created
ant.mkdir(dir: "${project.reporting.baseDir.path}/gmetrics")
ant.gmetrics(metricSetFile: 'file:gradle/gmetrics-metricset.groovy') {
report(type: 'org.gmetrics.report.BasicHtmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.html")
}
report(type: 'org.gmetrics.report.XmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.xml")
}
fileset(dir: 'src') {
include(name: '**/*.groovy')
//exclusions to filter out any classes with inner classes - sonar doesn't support
exclude(name: '**/*Config*')
}
}
}
}
13 changes: 13 additions & 0 deletions config/publish-snapshot.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Allow publishing builds to an S3 bucket for testing in other projects
publishing {
repositories {
maven {
// AWS_S3_URL = s3://bucketid/
url System.getenv('AWS_S3_URL')
credentials(AwsCredentials) {
accessKey System.getenv('AWS_ACCESS_KEY_ID')
secretKey System.getenv('AWS_SECRET_ACCESS_KEY')
}
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ systemProp.sonar.jdbc.url=jdbc:postgresql://localhost/sonar
systemProp.sonar.jdbc.username=sonar
systemProp.sonar.jdbc.password=sonar

org.gradle.parallel=true

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jun 13 18:46:33 CEST 2015
#Tue Dec 06 16:14:09 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
74 changes: 41 additions & 33 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
#!/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=""

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

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 02342d9

Please sign in to comment.