A Gradle plugin to help submit solutions to the Google HashCode competition
This plugin adds 3 tasks:
srcZip
: creates a ZIP file for all sources from themain
source setrunAllInputs
: runs your main class, passing all input files from the input folder as argumentssubmit
: an empty task that just depends on bothsrcZip
andrunAllInputs
The locations of the input files and output ZIP file are configurable (see below).
- the Java or Kotlin plugin, to determine the
main
source set - the
application
plugin (to define your main class)
Apply the plugin this way:
plugins {
application
id("org.hildan.hashcode-submit") version "0.2.0"
}
application {
mainClass.set("com.example.MainKt")
}
Additional configuration and its default values:
hashcode {
// directory where all input files reside
inputsDir = Paths.get("${project.projectDir}/inputs")
// the path to the ZIP file of the sources
srcZipFile = Paths.get("${project.projectDir}/outputs/sources.zip")
}