joffrey-bion / hashcode-submit-gradle-plugin

A Gradle plugin to help submit solutions to the Google HashCode competition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ The HashCode competition will no longer be organized by Google, so the value of this repository is greatly reduced, and thus the repo is archived. Feel free to reuse the code for some other competitive programming that require the zipped sources, though.

HashCode Submit Gradle Plugin

Gradle plugin version Github Build License

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 the main source set
  • runAllInputs: runs your main class, passing all input files from the input folder as arguments
  • submit: an empty task that just depends on both srcZip and runAllInputs

The locations of the input files and output ZIP file are configurable (see below).

Prerequisites

  • the Java or Kotlin plugin, to determine the main source set
  • the application plugin (to define your main class)

Usage

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")
}

About

A Gradle plugin to help submit solutions to the Google HashCode competition

License:MIT License


Languages

Language:Kotlin 100.0%