Skip to content

Commit

Permalink
Add travis build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mistzzt committed Oct 30, 2017
1 parent 6db92a9 commit 4f555fc
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: java

jdk:
- oraclejdk8

# see https://github.com/travis-ci/travis-ci/issues/8408
before_install:
- unset _JAVA_OPTIONS
- git clone https://github.com/google/google-java-format.git
- cd google-java-format
- patch ./core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java < ../patches/line.patch

# use travis-ci docker based infrastructure
sudo: false

cache:
directories:
- $HOME/.m2

install: mvn install -DskipTests=true -V

script: cp ./core/target/google-java-format-*-all-deps.jar ../bin/google-java-format.jar

after_success:
- cd ..
- mkdir release
- cp palint.py release/
- cp -r bin release/
- cd release
- wget https://sourceforge.net/projects/checkstyle/files/latest/download
- mv download bin/checkstyle.jar
- zip -r release.zip .

deploy:
provider: releases
api-key: $GITHUB_TOKEN
file: release.zip
skip_cleanup: true
on:
tags: true
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# cse-pa-lint
# cse-pa-lint [![Build Status](https://travis-ci.org/mistzzt/cse-pa-lint.svg)][travis]
Detecting possible style in-correction in programming assignments

[travis]: <https://travis-ci.org/mistzzt/cse-pa-lint>
4 changes: 2 additions & 2 deletions palint.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

HOME = os.path.expanduser('~/')
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
CHECKSTYLE_PATH = os.path.join(SCRIPT_DIR, 'bin', 'checkstyle-8.3-all.jar')
CHECKSTYLE_PATH = os.path.join(SCRIPT_DIR, 'bin', 'checkstyle.jar')
STYLE_CONFIG_PATH = os.path.join(SCRIPT_DIR, 'bin', 'google_checks.xml')
FORMATTER_PATH = os.path.join(SCRIPT_DIR, 'bin', 'google-java-format-1.6-SNAPSHOT-CSE11-all-deps.jar')
FORMATTER_PATH = os.path.join(SCRIPT_DIR, 'bin', 'google-java-format.jar')

CONFIG_FILE_NAME = 'config.json'
COMPILE_ERROR_FILE_NAME = 'compile_error.log'
Expand Down
11 changes: 11 additions & 0 deletions patches/line.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- JavaFormatterOptions.java 2017-10-29 21:23:59.057733900 -0700
+++ Modified.java 2017-10-29 21:33:17.479177900 -0700
@@ -29,7 +29,7 @@
@Immutable
public class JavaFormatterOptions {

- static final int DEFAULT_MAX_LINE_LENGTH = 100;
+ static final int DEFAULT_MAX_LINE_LENGTH = 80;

public enum Style {

0 comments on commit 4f555fc

Please sign in to comment.