Skip to content

Commit

Permalink
Include checkstyle suppressions
Browse files Browse the repository at this point in the history
Upgrade gradle
Remove jitpack - didn't seem to be working
Added instructions to readme for configuring checkstyle and formatter
  • Loading branch information
Andrew Sumner committed Oct 9, 2017
1 parent e4805b1 commit c8072a0
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 110 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,35 @@ The framework is easy to configure, for example supported browsers are simple to

It is built in Java using [Concordion](http://concordion.org) and incorporates numerous extensions.

## Contributing

All contributions are welcome, we do ask however that you follow our coding standards. This is rather easy as we have checkstyle and code formatter configuration files ready to use.

For eclipse:

1. Install checkstyle plugin
1. Eclipse > Preferences > Checkstyle > New …

Type: External configuration file
Name: Cubano
Location: <workspace>/cubano/config/checkstyle/checkstyle.xml

1. Eclipse > Preferences > Java > Code Style > Formatter > Import …

File: <workspace>/cubano/config/formatter/formatter.xml

1. Eclipse > Preferences > Java > Editor > Save Actions

Perform the selected actions on save: Checked
Format source code: Format edited lines
Organise imports: Checked

1. Eclipse > Project > Properties > Checkstyle

Checkstyle active for this project: Checked
Use the following check configuration for all files: Cubano - (Global)


## Valued Partners

Thanks to [Structure 101](http://structure101.com/) for their software architecture visualisation tool - helping us keep the architecture in check.
Expand Down
16 changes: 4 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,16 @@ subprojects {
}

checkstyle {
// toolVersion = '6.19'
ignoreFailures = true
// configProperties = ["baseDir" : project(':').file('../config/checkstyle')]

// Using default location /config/checkstyle/checkstyle.xml
configFile = new File("${rootDir}/config/checkstyle/checkstyle.xml")

// Exclude other source sets
//sourceSets = [sourceSets.main, sourceSets.test]
configDir = new File("${rootDir}/config/checkstyle")
}

findbugs {
toolVersion = "3.0.1"
ignoreFailures = true
// Exclude other source sets
//sourceSets = [sourceSets.main, sourceSets.test]
}
/*

/*
javadoc {
outputs.upToDateWhen { false } // ensure the task runs each time, even if no changes to code
Expand All @@ -124,7 +116,7 @@ subprojects {
// }

task wrapper(type: Wrapper) {
gradleVersion = '4.0'
gradleVersion = '4.2.1'

// To download through proxy, need to update <project root>\gradle\wrapper\gradle-wrapper.properties and change
// distributionUrl property from https... to http...
Expand Down
6 changes: 3 additions & 3 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
-->
<module name="Checker">
<!--<module name="SuppressWarningsFilter" />-->
<!--<module name="SuppressionFilter">-->
<!--<property name="file" value="${baseDir}/checkstyle-suppressions.xml"/>-->
<!--</module>-->
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<property name="severity" value="info"/>

Expand Down
File renamed without changes.
17 changes: 11 additions & 6 deletions cubano-webdriver/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
repositories {
maven { url "https://jitpack.io" }
}

// TODO Nigel: how do I get this working in multiproject
//repositories {
// maven { url "https://jitpack.io" }
//}

dependencies {
compile project(':cubano-config')
compile project(':cubano-http')
Expand All @@ -9,15 +12,17 @@ dependencies {
compile "org.seleniumhq.selenium:selenium-java:3.6.0"

// Html Elements
// compile('ru.yandex.qatools.htmlelements:htmlelements-java:1.18') {
// exclude group: 'org.seleniumhq.selenium', module: 'selenium-java'
// }
compile('ru.yandex.qatools.htmlelements:htmlelements-java:1.18') {
exclude group: 'org.seleniumhq.selenium', module: 'selenium-java'
}

/*
// This uses Jitpack to build and import multiple modules from Github
// Can revert to above once 1.19 is released
compile('com.github.yandex-qatools.htmlelements:htmlelements-java:master-SNAPSHOT') {
exclude group: 'org.seleniumhq.selenium', module: 'selenium-java'
}
*/

compile 'org.jsoup:jsoup:1.8.3'

Expand Down
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 Jul 01 11:37:33 NZST 2017
#Mon Oct 09 22:37:45 NZDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# 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 Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
168 changes: 84 additions & 84 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

0 comments on commit c8072a0

Please sign in to comment.