From 766055e3137a87d83e763e9516d48b12d3dc0a97 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 17:09:39 +0200 Subject: [PATCH 01/14] use lix for build system --- .haxerc | 4 ++ .travis.yml | 75 +++++++++++-------------------- CHANGELOG.md | 2 + build/Build.hx | 17 +++++++ buildAll.hxml | 19 +------- buildGlobal.hxml | 4 +- buildSchema.hxml | 1 - buildTelemetry.hxml | 2 - buildTest.hxml | 1 - haxe3_libraries/compiletime.hxml | 3 ++ haxe3_libraries/haxeparser.hxml | 4 ++ haxe3_libraries/hxargs.hxml | 3 ++ haxe3_libraries/hxjava.hxml | 5 +++ haxe3_libraries/hxjsonast.hxml | 3 ++ haxe3_libraries/hxnodejs.hxml | 6 +++ haxe3_libraries/hxparse.hxml | 3 ++ haxe3_libraries/json2object.hxml | 4 ++ haxe3_libraries/mconsole.hxml | 3 ++ haxe3_libraries/mcover.hxml | 5 +++ haxe3_libraries/mlib.hxml | 4 ++ haxe3_libraries/munit.hxml | 6 +++ haxe3_libraries/test-adapter.hxml | 5 +++ haxe3_libraries/tokentree.hxml | 3 ++ haxe_libraries/compiletime.hxml | 3 ++ haxe_libraries/haxeparser.hxml | 4 ++ haxe_libraries/hxargs.hxml | 3 ++ haxe_libraries/hxcpp.hxml | 4 ++ haxe_libraries/hxjava.hxml | 5 +++ haxe_libraries/hxjsonast.hxml | 3 ++ haxe_libraries/hxnodejs.hxml | 6 +++ haxe_libraries/hxparse.hxml | 3 ++ haxe_libraries/json2object.hxml | 4 ++ haxe_libraries/mconsole.hxml | 3 ++ haxe_libraries/mcover.hxml | 5 +++ haxe_libraries/mlib.hxml | 4 ++ haxe_libraries/munit.hxml | 6 +++ haxe_libraries/test-adapter.hxml | 5 +++ haxe_libraries/tokentree.hxml | 3 ++ makeReleaseZip.sh | 10 +++++ package-lock.json | 14 ++++++ package.json | 18 +++----- 41 files changed, 201 insertions(+), 84 deletions(-) create mode 100644 .haxerc create mode 100644 build/Build.hx create mode 100644 haxe3_libraries/compiletime.hxml create mode 100644 haxe3_libraries/haxeparser.hxml create mode 100644 haxe3_libraries/hxargs.hxml create mode 100644 haxe3_libraries/hxjava.hxml create mode 100644 haxe3_libraries/hxjsonast.hxml create mode 100644 haxe3_libraries/hxnodejs.hxml create mode 100644 haxe3_libraries/hxparse.hxml create mode 100644 haxe3_libraries/json2object.hxml create mode 100644 haxe3_libraries/mconsole.hxml create mode 100644 haxe3_libraries/mcover.hxml create mode 100644 haxe3_libraries/mlib.hxml create mode 100644 haxe3_libraries/munit.hxml create mode 100644 haxe3_libraries/test-adapter.hxml create mode 100644 haxe3_libraries/tokentree.hxml create mode 100644 haxe_libraries/compiletime.hxml create mode 100644 haxe_libraries/haxeparser.hxml create mode 100644 haxe_libraries/hxargs.hxml create mode 100644 haxe_libraries/hxcpp.hxml create mode 100644 haxe_libraries/hxjava.hxml create mode 100644 haxe_libraries/hxjsonast.hxml create mode 100644 haxe_libraries/hxnodejs.hxml create mode 100644 haxe_libraries/hxparse.hxml create mode 100644 haxe_libraries/json2object.hxml create mode 100644 haxe_libraries/mconsole.hxml create mode 100644 haxe_libraries/mcover.hxml create mode 100644 haxe_libraries/mlib.hxml create mode 100644 haxe_libraries/munit.hxml create mode 100644 haxe_libraries/test-adapter.hxml create mode 100644 haxe_libraries/tokentree.hxml create mode 100755 makeReleaseZip.sh create mode 100644 package-lock.json diff --git a/.haxerc b/.haxerc new file mode 100644 index 00000000..14e48917 --- /dev/null +++ b/.haxerc @@ -0,0 +1,4 @@ +{ + "version": "4.0.0-rc.5", + "resolveLibs": "scoped" +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 51c5a88d..e9870fb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,53 +1,30 @@ -git: - depth: 1 - -language: haxe - -after_success: - - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" +language: node_js +node_js: + - "10" sudo: false dist: xenial -script: - - haxe build.hxml - - haxe buildDebug.hxml - - haxe buildJS.hxml - - haxe buildCpp.hxml - - haxe buildSchema.hxml - - haxe -D codecov_json buildTest.hxml - - haxe testJava.hxml +env: + - HAXE_VERSION=haxe347 + - HAXE_VERSION=haxe4rc5 + - HAXE_VERSION=nightly -matrix: - include: - - haxe: 3.4.7 - install: - - haxelib git tokentree https://github.com/HaxeCheckstyle/tokentree master src - - haxelib git hxnodejs https://github.com/HaxeFoundation/hxnodejs.git master - - haxelib git json2object https://github.com/elnabo/json2object - - haxelib git mcover https://github.com/massiveinteractive/mcover master src - - haxelib git munit https://github.com/massiveinteractive/MassiveUnit master src - - haxelib install hxjava - - haxelib install hxcpp - - haxelib install haxeparser 3.3.0 - - haxelib install compiletime 2.6.0 - - haxelib install hxargs 3.0.2 - - haxelib install mconsole - - haxelib install mlib - - haxelib install test-adapter - - haxe: development - install: - - haxelib git tokentree https://github.com/HaxeCheckstyle/tokentree master src - - haxelib git hxparse https://github.com/simn/hxparse - - haxelib git haxeparser https://github.com/simn/haxeparser - - haxelib git mcover https://github.com/massiveinteractive/mcover master src - - haxelib git munit https://github.com/massiveinteractive/MassiveUnit master src - - haxelib git hxnodejs https://github.com/HaxeFoundation/hxnodejs.git master - - haxelib git json2object https://github.com/elnabo/json2object - - haxelib install hxjava - - haxelib install hxcpp - - haxelib install mlib - - haxelib install mconsole - - haxelib install compiletime 2.6.0 - - haxelib install hxargs 3.0.2 - - haxelib install test-adapter - - sed -i 's/:3.3.0//' buildGlobal.hxml +install: + - npm install + - if [[ "$HAXE_VERSION" == "haxe347" ]]; then mv haxe_libraries haxe4_libraries; mv haxe3_libraries haxe_libraries; fi + - if [[ "$HAXE_VERSION" == "haxe347" ]]; then npx lix download haxe 3.4.7; npx lix use haxe 3.4.7; fi + - if [[ "$HAXE_VERSION" == "haxe4rc5" ]]; then npx lix download haxe 4.0.0-rc.5; npx lix use haxe 4.0.0-rc.5; fi + - if [[ "$HAXE_VERSION" == "nightly" ]]; then npx lix download haxe nightly; npx lix use haxe nightly; fi + - npx lix download + - npx haxe -version + - npx neko -version + - npx haxelib list + +script: + - npx haxe build.hxml + - npx haxe buildDebug.hxml + - npx haxe buildJS.hxml + - npx haxe buildCpp.hxml + - npx haxe buildSchema.hxml + - npx haxe -D codecov_json buildTest.hxml + - npx haxe testJava.hxml diff --git a/CHANGELOG.md b/CHANGELOG.md index cb43de9b..451cd0d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## dev branch / next version (2.x.x) +- Refactored build system to use lix + ## version 2.5.0 (2019-10-10) - **Breaking Change** split `OperatorWhitespaceCheck.functionArgPolicy` into `arrowFunctionPolicy`, `oldFunctionTypePolicy` and `newFunctionTypePolicy` [#467](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/467) diff --git a/build/Build.hx b/build/Build.hx new file mode 100644 index 00000000..613001bf --- /dev/null +++ b/build/Build.hx @@ -0,0 +1,17 @@ +import haxe.Timer; + +class Build { + public static function main() { + callLix("build.hxml", "run.n"); + callLix("buildDebug.hxml", "runD.n"); + callLix("buildJS.hxml", "run.js"); + callLix("buildSchema.hxml", "Json schema"); + callLix("buildTest.hxml", "Unittests"); + } + + public static function callLix(buildFile:String, title:String) { + var startTime = Timer.stamp(); + Sys.command("npx", ["haxe", buildFile]); + Sys.println('building $title (${Timer.stamp() - startTime})'); + } +} \ No newline at end of file diff --git a/buildAll.hxml b/buildAll.hxml index ba62f63d..2b433720 100644 --- a/buildAll.hxml +++ b/buildAll.hxml @@ -1,17 +1,2 @@ -build.hxml - ---next - -buildDebug.hxml - ---next - -buildJS.hxml - ---next - -buildSchema.hxml - ---next - -buildTest.hxml \ No newline at end of file +-cp build +--run Build \ No newline at end of file diff --git a/buildGlobal.hxml b/buildGlobal.hxml index b2673c62..065171a3 100644 --- a/buildGlobal.hxml +++ b/buildGlobal.hxml @@ -1,5 +1,5 @@ -cp src -lib haxeparser --lib compiletime:2.6.0 --lib hxargs:3.0.2 +-lib compiletime +-lib hxargs -lib tokentree \ No newline at end of file diff --git a/buildSchema.hxml b/buildSchema.hxml index a161ca41..b2b1029f 100644 --- a/buildSchema.hxml +++ b/buildSchema.hxml @@ -1,4 +1,3 @@ buildGlobal.hxml -cp schema --xml resources/schema.xml -x SchemaGenerator diff --git a/buildTelemetry.hxml b/buildTelemetry.hxml index 00113b88..842ccfc6 100644 --- a/buildTelemetry.hxml +++ b/buildTelemetry.hxml @@ -1,8 +1,6 @@ buildGlobal.hxml -lib hxtelemetry ---each - -D HXCPP_STACK_TRACE -D HXCPP_TELEMETRY diff --git a/buildTest.hxml b/buildTest.hxml index bc35feb4..9ff45fed 100644 --- a/buildTest.hxml +++ b/buildTest.hxml @@ -7,7 +7,6 @@ buildGlobal.hxml -x TestMain --macro mcover.MCover.coverage(['checkstyle'], ['src'], ['checkstyle.reporter', 'checkstyle.Main']) ---next -cmd neko run -s src -s test -s schema -p resources/static-analysis.txt -cmd neko run --default-config resources/default-config.json -cmd neko run -c resources/default-config.json \ No newline at end of file diff --git a/haxe3_libraries/compiletime.hxml b/haxe3_libraries/compiletime.hxml new file mode 100644 index 00000000..921e164a --- /dev/null +++ b/haxe3_libraries/compiletime.hxml @@ -0,0 +1,3 @@ +-D compiletime=2.8.0 +# @install: lix --silent download "haxelib:/compiletime#2.8.0" into compiletime/2.8.0/haxelib +-cp ${HAXE_LIBCACHE}/compiletime/2.8.0/haxelib/src/ diff --git a/haxe3_libraries/haxeparser.hxml b/haxe3_libraries/haxeparser.hxml new file mode 100644 index 00000000..d64f1f68 --- /dev/null +++ b/haxe3_libraries/haxeparser.hxml @@ -0,0 +1,4 @@ +-D haxeparser=3.3.0 +# @install: lix --silent download "gh://github.com/Simn/haxeparser#48160b190cacafb0003d0c8d085dca2c85e21e31" into haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31 +-lib hxparse +-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31/src diff --git a/haxe3_libraries/hxargs.hxml b/haxe3_libraries/hxargs.hxml new file mode 100644 index 00000000..646e484a --- /dev/null +++ b/haxe3_libraries/hxargs.hxml @@ -0,0 +1,3 @@ +-D hxargs=3.0.2 +# @install: lix --silent download "gh://github.com/Simn/hxargs#27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24" into hxargs/3.0.2/github/27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24 +-cp ${HAXE_LIBCACHE}/hxargs/3.0.2/github/27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24/ diff --git a/haxe3_libraries/hxjava.hxml b/haxe3_libraries/hxjava.hxml new file mode 100644 index 00000000..0942a5aa --- /dev/null +++ b/haxe3_libraries/hxjava.hxml @@ -0,0 +1,5 @@ +-D hxjava=3.2.0 +# @install: lix --silent download "haxelib:/hxjava#3.2.0" into hxjava/3.2.0/haxelib +# @run: haxelib run-dir hxjava ${HAXE_LIBCACHE}/hxjava/3.2.0/haxelib +-cp ${HAXE_LIBCACHE}/hxjava/3.2.0/haxelib/ +-java-lib lib/hxjava-std.jar diff --git a/haxe3_libraries/hxjsonast.hxml b/haxe3_libraries/hxjsonast.hxml new file mode 100644 index 00000000..b7480867 --- /dev/null +++ b/haxe3_libraries/hxjsonast.hxml @@ -0,0 +1,3 @@ +-D hxjsonast=1.0.1 +# @install: lix --silent download "haxelib:/hxjsonast#1.0.1" into hxjsonast/1.0.1/haxelib +-cp ${HAXE_LIBCACHE}/hxjsonast/1.0.1/haxelib/src diff --git a/haxe3_libraries/hxnodejs.hxml b/haxe3_libraries/hxnodejs.hxml new file mode 100644 index 00000000..1bfe8128 --- /dev/null +++ b/haxe3_libraries/hxnodejs.hxml @@ -0,0 +1,6 @@ +-D hxnodejs=10.0.0 +# @install: lix --silent download "gh://github.com/HaxeFoundation/hxnodejs#462c800e16aa0b91df5a7c5d54782b313c3f8730" into hxnodejs/10.0.0/github/462c800e16aa0b91df5a7c5d54782b313c3f8730 +-cp ${HAXE_LIBCACHE}/hxnodejs/10.0.0/github/462c800e16aa0b91df5a7c5d54782b313c3f8730/src +--macro allowPackage('sys') +# should behave like other target defines and not be defined in macro context +--macro define('nodejs') diff --git a/haxe3_libraries/hxparse.hxml b/haxe3_libraries/hxparse.hxml new file mode 100644 index 00000000..48696312 --- /dev/null +++ b/haxe3_libraries/hxparse.hxml @@ -0,0 +1,3 @@ +-D hxparse=4.0.0 +# @install: lix --silent download "gh://github.com/Simn/hxparse#f61faa2021f2abb85360f997ff72c4156c891adc" into hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc +-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc/src diff --git a/haxe3_libraries/json2object.hxml b/haxe3_libraries/json2object.hxml new file mode 100644 index 00000000..416bed19 --- /dev/null +++ b/haxe3_libraries/json2object.hxml @@ -0,0 +1,4 @@ +-D json2object=3.6.4 +# @install: lix --silent download "gh://github.com/elnabo/json2object#bd00ad1713bf6bda06d8a7c9ddc90888e8a6094c" into json2object/3.6.4/github/bd00ad1713bf6bda06d8a7c9ddc90888e8a6094c +-lib hxjsonast +-cp ${HAXE_LIBCACHE}/json2object/3.6.4/github/bd00ad1713bf6bda06d8a7c9ddc90888e8a6094c/src diff --git a/haxe3_libraries/mconsole.hxml b/haxe3_libraries/mconsole.hxml new file mode 100644 index 00000000..71425849 --- /dev/null +++ b/haxe3_libraries/mconsole.hxml @@ -0,0 +1,3 @@ +-D mconsole=1.6.0 +# @install: lix --silent download "haxelib:/mconsole#1.6.0" into mconsole/1.6.0/haxelib +-cp ${HAXE_LIBCACHE}/mconsole/1.6.0/haxelib/ diff --git a/haxe3_libraries/mcover.hxml b/haxe3_libraries/mcover.hxml new file mode 100644 index 00000000..3ec60840 --- /dev/null +++ b/haxe3_libraries/mcover.hxml @@ -0,0 +1,5 @@ +-D mcover=2.2.1 +# @install: lix --silent download "haxelib:/mcover#2.2.1" into mcover/2.2.1/haxelib +-lib mconsole +-lib munit +-cp ${HAXE_LIBCACHE}/mcover/2.2.1/haxelib/ diff --git a/haxe3_libraries/mlib.hxml b/haxe3_libraries/mlib.hxml new file mode 100644 index 00000000..49230501 --- /dev/null +++ b/haxe3_libraries/mlib.hxml @@ -0,0 +1,4 @@ +-D mlib=2.0.3 +# @install: lix --silent download "haxelib:/mlib#2.0.3" into mlib/2.0.3/haxelib +# @run: haxelib run-dir mlib ${HAXE_LIBCACHE}/mlib/2.0.3/haxelib +-cp ${HAXE_LIBCACHE}/mlib/2.0.3/haxelib/ diff --git a/haxe3_libraries/munit.hxml b/haxe3_libraries/munit.hxml new file mode 100644 index 00000000..8e364c38 --- /dev/null +++ b/haxe3_libraries/munit.hxml @@ -0,0 +1,6 @@ +-D munit=2.3.4 +# @install: lix --silent download "haxelib:/munit#2.3.4" into munit/2.3.4/haxelib +# @run: haxelib run-dir munit ${HAXE_LIBCACHE}/munit/2.3.4/haxelib +-lib mcover +-lib mlib +-cp ${HAXE_LIBCACHE}/munit/2.3.4/haxelib/ diff --git a/haxe3_libraries/test-adapter.hxml b/haxe3_libraries/test-adapter.hxml new file mode 100644 index 00000000..5b60bc2b --- /dev/null +++ b/haxe3_libraries/test-adapter.hxml @@ -0,0 +1,5 @@ +-D test-adapter=1.2.5 +# @install: lix --silent download "haxelib:/test-adapter#1.2.5" into test-adapter/1.2.5/haxelib +-lib json2object +-cp ${HAXE_LIBCACHE}/test-adapter/1.2.5/haxelib/ +--macro _testadapter.Macro.init() \ No newline at end of file diff --git a/haxe3_libraries/tokentree.hxml b/haxe3_libraries/tokentree.hxml new file mode 100644 index 00000000..df0d235d --- /dev/null +++ b/haxe3_libraries/tokentree.hxml @@ -0,0 +1,3 @@ +-D tokentree=1.0.23 +# @install: lix --silent download "gh://github.com/HaxeCheckstyle/tokentree#3b66fcf61e55178e75c01168a58c0cdece198e48" into tokentree/1.0.23/github/3b66fcf61e55178e75c01168a58c0cdece198e48 +-cp ${HAXE_LIBCACHE}/tokentree/1.0.23/github/3b66fcf61e55178e75c01168a58c0cdece198e48/src diff --git a/haxe_libraries/compiletime.hxml b/haxe_libraries/compiletime.hxml new file mode 100644 index 00000000..921e164a --- /dev/null +++ b/haxe_libraries/compiletime.hxml @@ -0,0 +1,3 @@ +-D compiletime=2.8.0 +# @install: lix --silent download "haxelib:/compiletime#2.8.0" into compiletime/2.8.0/haxelib +-cp ${HAXE_LIBCACHE}/compiletime/2.8.0/haxelib/src/ diff --git a/haxe_libraries/haxeparser.hxml b/haxe_libraries/haxeparser.hxml new file mode 100644 index 00000000..4756bf0d --- /dev/null +++ b/haxe_libraries/haxeparser.hxml @@ -0,0 +1,4 @@ +-D haxeparser=3.3.0 +# @install: lix --silent download "gh://github.com/Simn/haxeparser#e5746bfc55c09a3694db42738ff575b91441971a" into haxeparser/3.3.0/github/e5746bfc55c09a3694db42738ff575b91441971a +-lib hxparse +-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/e5746bfc55c09a3694db42738ff575b91441971a/src diff --git a/haxe_libraries/hxargs.hxml b/haxe_libraries/hxargs.hxml new file mode 100644 index 00000000..646e484a --- /dev/null +++ b/haxe_libraries/hxargs.hxml @@ -0,0 +1,3 @@ +-D hxargs=3.0.2 +# @install: lix --silent download "gh://github.com/Simn/hxargs#27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24" into hxargs/3.0.2/github/27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24 +-cp ${HAXE_LIBCACHE}/hxargs/3.0.2/github/27eb1114ebcc82fe02abf2cfa3738ae6f43b0e24/ diff --git a/haxe_libraries/hxcpp.hxml b/haxe_libraries/hxcpp.hxml new file mode 100644 index 00000000..a1f3d7a3 --- /dev/null +++ b/haxe_libraries/hxcpp.hxml @@ -0,0 +1,4 @@ +-D hxcpp=4.0.52 +# @install: lix --silent download "haxelib:/hxcpp#4.0.52" into hxcpp/4.0.52/haxelib +# @run: haxelib run-dir hxcpp ${HAXE_LIBCACHE}/hxcpp/4.0.52/haxelib +-cp ${HAXE_LIBCACHE}/hxcpp/4.0.52/haxelib/ diff --git a/haxe_libraries/hxjava.hxml b/haxe_libraries/hxjava.hxml new file mode 100644 index 00000000..6662244f --- /dev/null +++ b/haxe_libraries/hxjava.hxml @@ -0,0 +1,5 @@ +-D hxjava=4.0.0-alpha +# @install: lix --silent download "haxelib:/hxjava#4.0.0-alpha" into hxjava/4.0.0-alpha/haxelib +# @run: haxelib run-dir hxjava ${HAXE_LIBCACHE}/hxjava/4.0.0-alpha/haxelib +-cp ${HAXE_LIBCACHE}/hxjava/4.0.0-alpha/haxelib/ +-java-lib lib/hxjava-std.jar diff --git a/haxe_libraries/hxjsonast.hxml b/haxe_libraries/hxjsonast.hxml new file mode 100644 index 00000000..b7480867 --- /dev/null +++ b/haxe_libraries/hxjsonast.hxml @@ -0,0 +1,3 @@ +-D hxjsonast=1.0.1 +# @install: lix --silent download "haxelib:/hxjsonast#1.0.1" into hxjsonast/1.0.1/haxelib +-cp ${HAXE_LIBCACHE}/hxjsonast/1.0.1/haxelib/src diff --git a/haxe_libraries/hxnodejs.hxml b/haxe_libraries/hxnodejs.hxml new file mode 100644 index 00000000..1bfe8128 --- /dev/null +++ b/haxe_libraries/hxnodejs.hxml @@ -0,0 +1,6 @@ +-D hxnodejs=10.0.0 +# @install: lix --silent download "gh://github.com/HaxeFoundation/hxnodejs#462c800e16aa0b91df5a7c5d54782b313c3f8730" into hxnodejs/10.0.0/github/462c800e16aa0b91df5a7c5d54782b313c3f8730 +-cp ${HAXE_LIBCACHE}/hxnodejs/10.0.0/github/462c800e16aa0b91df5a7c5d54782b313c3f8730/src +--macro allowPackage('sys') +# should behave like other target defines and not be defined in macro context +--macro define('nodejs') diff --git a/haxe_libraries/hxparse.hxml b/haxe_libraries/hxparse.hxml new file mode 100644 index 00000000..48696312 --- /dev/null +++ b/haxe_libraries/hxparse.hxml @@ -0,0 +1,3 @@ +-D hxparse=4.0.0 +# @install: lix --silent download "gh://github.com/Simn/hxparse#f61faa2021f2abb85360f997ff72c4156c891adc" into hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc +-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc/src diff --git a/haxe_libraries/json2object.hxml b/haxe_libraries/json2object.hxml new file mode 100644 index 00000000..8e7a7317 --- /dev/null +++ b/haxe_libraries/json2object.hxml @@ -0,0 +1,4 @@ +-D json2object=3.6.4 +# @install: lix --silent download "haxelib:/json2object#3.6.4" into json2object/3.6.4/haxelib +-lib hxjsonast +-cp ${HAXE_LIBCACHE}/json2object/3.6.4/haxelib/src diff --git a/haxe_libraries/mconsole.hxml b/haxe_libraries/mconsole.hxml new file mode 100644 index 00000000..71425849 --- /dev/null +++ b/haxe_libraries/mconsole.hxml @@ -0,0 +1,3 @@ +-D mconsole=1.6.0 +# @install: lix --silent download "haxelib:/mconsole#1.6.0" into mconsole/1.6.0/haxelib +-cp ${HAXE_LIBCACHE}/mconsole/1.6.0/haxelib/ diff --git a/haxe_libraries/mcover.hxml b/haxe_libraries/mcover.hxml new file mode 100644 index 00000000..3ec60840 --- /dev/null +++ b/haxe_libraries/mcover.hxml @@ -0,0 +1,5 @@ +-D mcover=2.2.1 +# @install: lix --silent download "haxelib:/mcover#2.2.1" into mcover/2.2.1/haxelib +-lib mconsole +-lib munit +-cp ${HAXE_LIBCACHE}/mcover/2.2.1/haxelib/ diff --git a/haxe_libraries/mlib.hxml b/haxe_libraries/mlib.hxml new file mode 100644 index 00000000..49230501 --- /dev/null +++ b/haxe_libraries/mlib.hxml @@ -0,0 +1,4 @@ +-D mlib=2.0.3 +# @install: lix --silent download "haxelib:/mlib#2.0.3" into mlib/2.0.3/haxelib +# @run: haxelib run-dir mlib ${HAXE_LIBCACHE}/mlib/2.0.3/haxelib +-cp ${HAXE_LIBCACHE}/mlib/2.0.3/haxelib/ diff --git a/haxe_libraries/munit.hxml b/haxe_libraries/munit.hxml new file mode 100644 index 00000000..8e364c38 --- /dev/null +++ b/haxe_libraries/munit.hxml @@ -0,0 +1,6 @@ +-D munit=2.3.4 +# @install: lix --silent download "haxelib:/munit#2.3.4" into munit/2.3.4/haxelib +# @run: haxelib run-dir munit ${HAXE_LIBCACHE}/munit/2.3.4/haxelib +-lib mcover +-lib mlib +-cp ${HAXE_LIBCACHE}/munit/2.3.4/haxelib/ diff --git a/haxe_libraries/test-adapter.hxml b/haxe_libraries/test-adapter.hxml new file mode 100644 index 00000000..5b60bc2b --- /dev/null +++ b/haxe_libraries/test-adapter.hxml @@ -0,0 +1,5 @@ +-D test-adapter=1.2.5 +# @install: lix --silent download "haxelib:/test-adapter#1.2.5" into test-adapter/1.2.5/haxelib +-lib json2object +-cp ${HAXE_LIBCACHE}/test-adapter/1.2.5/haxelib/ +--macro _testadapter.Macro.init() \ No newline at end of file diff --git a/haxe_libraries/tokentree.hxml b/haxe_libraries/tokentree.hxml new file mode 100644 index 00000000..df0d235d --- /dev/null +++ b/haxe_libraries/tokentree.hxml @@ -0,0 +1,3 @@ +-D tokentree=1.0.23 +# @install: lix --silent download "gh://github.com/HaxeCheckstyle/tokentree#3b66fcf61e55178e75c01168a58c0cdece198e48" into tokentree/1.0.23/github/3b66fcf61e55178e75c01168a58c0cdece198e48 +-cp ${HAXE_LIBCACHE}/tokentree/1.0.23/github/3b66fcf61e55178e75c01168a58c0cdece198e48/src diff --git a/makeReleaseZip.sh b/makeReleaseZip.sh new file mode 100755 index 00000000..989675ea --- /dev/null +++ b/makeReleaseZip.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e + +npm install +npx lix download +npx lix use haxe 4.0.0-rc.5 + +npx haxe buildAll.hxml + +rm -f haxe-checkstyle.zip +zip -9 -r -q haxe-checkstyle.zip src run.n haxecheckstyle.js resources/sample-config.json resources/logo.png resources/codeclimate_pr.png haxelib.json README.md CHANGELOG.md LICENSE.md diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..38950e30 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "haxe-checkstyle", + "version": "2.5.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "lix": { + "version": "15.5.4", + "resolved": "https://registry.npmjs.org/lix/-/lix-15.5.4.tgz", + "integrity": "sha512-abOUxMKCcdoR5WUA8Sos5nE/AuXG02/aHkIwzZ7D3uckBcyvhgGOo0NLlMoZEHCLngtvvJ3QvS2KqQa/o+8Upg==", + "dev": true + } + } +} diff --git a/package.json b/package.json index e3e7441b..8cd6e667 100644 --- a/package.json +++ b/package.json @@ -20,23 +20,17 @@ "name": "Alexander Blum", "email": "Alexander.Blum@gmail.com" }, - "contributors": [{ + "contributors": [ + { "name": "Adi Reddy Mora" }, { "name": "Jens Fischer" } ], - "dependencies": { - "grunt": "latest", - "grunt-cli": "latest" + "devDependencies": { + "lix": "^15.5.4" }, "bugs": "https://github.com/HaxeCheckstyle/haxe-checkstyle/issues", - "license": "MIT", - "devDependencies": { - "grunt": "^0.4.5", - "grunt-haxe": "^0.1.12", - "grunt-shell": "^1.1.1", - "grunt-zip": "^0.16.0" - } -} \ No newline at end of file + "license": "MIT" +} From e1c3b40a6cfce16f7c17a66c40a456eb17369b90 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 17:24:21 +0200 Subject: [PATCH 02/14] fixed Haxe 3 builds restored codecov upload --- .travis.yml | 3 +++ haxe3_libraries/haxeparser.hxml | 4 ++-- haxe3_libraries/hxparse.hxml | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9870fb6..307be078 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,3 +28,6 @@ script: - npx haxe buildSchema.hxml - npx haxe -D codecov_json buildTest.hxml - npx haxe testJava.hxml + +after_success: + - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/haxe3_libraries/haxeparser.hxml b/haxe3_libraries/haxeparser.hxml index d64f1f68..7a80b5f7 100644 --- a/haxe3_libraries/haxeparser.hxml +++ b/haxe3_libraries/haxeparser.hxml @@ -1,4 +1,4 @@ -D haxeparser=3.3.0 -# @install: lix --silent download "gh://github.com/Simn/haxeparser#48160b190cacafb0003d0c8d085dca2c85e21e31" into haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31 +# @install: lix --silent download "haxelib:/haxeparser#3.3.0" into haxeparser/3.3.0/haxelib -lib hxparse --cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31/src +-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/haxelib/src diff --git a/haxe3_libraries/hxparse.hxml b/haxe3_libraries/hxparse.hxml index 48696312..2201ba72 100644 --- a/haxe3_libraries/hxparse.hxml +++ b/haxe3_libraries/hxparse.hxml @@ -1,3 +1,3 @@ -D hxparse=4.0.0 -# @install: lix --silent download "gh://github.com/Simn/hxparse#f61faa2021f2abb85360f997ff72c4156c891adc" into hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc --cp ${HAXE_LIBCACHE}/hxparse/4.0.0/github/f61faa2021f2abb85360f997ff72c4156c891adc/src +# @install: lix --silent download "haxelib:/hxparse#4.0.0" into hxparse/4.0.0/haxelib +-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/haxelib/src From b37e2494fa51a1c123579cad68ac5303d0f458c2 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 17:27:21 +0200 Subject: [PATCH 03/14] added missing hxcpp dependency --- haxe3_libraries/hxcpp.hxml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 haxe3_libraries/hxcpp.hxml diff --git a/haxe3_libraries/hxcpp.hxml b/haxe3_libraries/hxcpp.hxml new file mode 100644 index 00000000..a1f3d7a3 --- /dev/null +++ b/haxe3_libraries/hxcpp.hxml @@ -0,0 +1,4 @@ +-D hxcpp=4.0.52 +# @install: lix --silent download "haxelib:/hxcpp#4.0.52" into hxcpp/4.0.52/haxelib +# @run: haxelib run-dir hxcpp ${HAXE_LIBCACHE}/hxcpp/4.0.52/haxelib +-cp ${HAXE_LIBCACHE}/hxcpp/4.0.52/haxelib/ From 3521c85e776bcff3e787a7d2ba5f2c52994e6632 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 17:48:57 +0200 Subject: [PATCH 04/14] updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 451cd0d3..43022bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## dev branch / next version (2.x.x) -- Refactored build system to use lix +- Refactored build system to use lix ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478)) ## version 2.5.0 (2019-10-10) From e86c4869dbd7339d9c4a7492a489720f48666de0 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:04:13 +0200 Subject: [PATCH 05/14] added codeclimate coverage reporting --- .travis.yml | 10 ++++++++++ test/TestMain.hx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 307be078..cd681d9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,11 @@ env: - HAXE_VERSION=haxe347 - HAXE_VERSION=haxe4rc5 - HAXE_VERSION=nightly + global: + - CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 install: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter - npm install - if [[ "$HAXE_VERSION" == "haxe347" ]]; then mv haxe_libraries haxe4_libraries; mv haxe3_libraries haxe_libraries; fi - if [[ "$HAXE_VERSION" == "haxe347" ]]; then npx lix download haxe 3.4.7; npx lix use haxe 3.4.7; fi @@ -20,6 +23,9 @@ install: - npx neko -version - npx haxelib list +before_script: + - ./cc-test-reporter before-build + script: - npx haxe build.hxml - npx haxe buildDebug.hxml @@ -29,5 +35,9 @@ script: - npx haxe -D codecov_json buildTest.hxml - npx haxe testJava.hxml +after_script: + - ./cc-test-reporter format-coverage -t lcov lcov.info + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + after_success: - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/test/TestMain.hx b/test/TestMain.hx index 3b1b158d..4e632df3 100644 --- a/test/TestMain.hx +++ b/test/TestMain.hx @@ -18,7 +18,7 @@ class TestMain { #if codecov_json MCoverage.getLogger().addClient(new CodecovJsonPrintClient()); #else - MCoverage.getLogger().addClient(new LcovPrintClient("Formatter Unittests")); + MCoverage.getLogger().addClient(new LcovPrintClient("Checkstyle Unittests")); #end var runner:TestRunner = new TestRunner(client); runner.completionHandler = completionHandler; From c3d0cf776a8a332ef2300c3b93573ca62174e454 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:06:36 +0200 Subject: [PATCH 06/14] fixed travis.yml envs --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd681d9e..00062631 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ env: - HAXE_VERSION=haxe347 - HAXE_VERSION=haxe4rc5 - HAXE_VERSION=nightly - global: - - CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 + - CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 install: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter From 6aa67f786fa2df62da6c65204f2800f1e9efe8ac Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:07:59 +0200 Subject: [PATCH 07/14] try different global env --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 00062631..5f1e520f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,10 @@ sudo: false dist: xenial env: + global: CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 - HAXE_VERSION=haxe347 - HAXE_VERSION=haxe4rc5 - HAXE_VERSION=nightly - - CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 install: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter From cbbd9d23e1a766427a0124c2adb9f247cf461538 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:10:32 +0200 Subject: [PATCH 08/14] try matrix + global for envs --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f1e520f..2b902223 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,12 @@ sudo: false dist: xenial env: - global: CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 - - HAXE_VERSION=haxe347 - - HAXE_VERSION=haxe4rc5 - - HAXE_VERSION=nightly + global: + - CC_TEST_REPORTER_ID=1dff6f89d7179dff5db635c6b4fe64acdd5694c9ed44d7da5f12f0f7d3d163b7 + matrix: + - HAXE_VERSION=haxe347 + - HAXE_VERSION=haxe4rc5 + - HAXE_VERSION=nightly install: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter From 23577f4b41796333e6fbaca16855a6a933b9ca97 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:28:26 +0200 Subject: [PATCH 09/14] fixed codeclimate coverage reporting --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b902223..f1538d31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,9 @@ script: - npx haxe testJava.hxml after_script: - - ./cc-test-reporter format-coverage -t lcov lcov.info - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + - (cd src; ../cc-test-reporter format-coverage -t lcov lcov.info) + - (cd src; ../cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT) + - (cd src; ../cc-test-reporter upload-coverage) after_success: - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" From d5bbbc245d351addc84d7e8796c111475b6d60f0 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:29:52 +0200 Subject: [PATCH 10/14] fixed path to lcov.info --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1538d31..676f74c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ script: - npx haxe testJava.hxml after_script: - - (cd src; ../cc-test-reporter format-coverage -t lcov lcov.info) + - (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info) - (cd src; ../cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT) - (cd src; ../cc-test-reporter upload-coverage) From d811b0ed12f162cba28497c158cf376977ed6d1b Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:39:07 +0200 Subject: [PATCH 11/14] remove after-build reporter call --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 676f74c3..681b1e29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,6 @@ script: after_script: - (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info) - - (cd src; ../cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT) - (cd src; ../cc-test-reporter upload-coverage) after_success: From 5638abb084bcbd5a42fc29a204c353a709100b60 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:43:08 +0200 Subject: [PATCH 12/14] also checkstyle new build folder --- build/Build.hx | 9 +++++++++ buildTest.hxml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build/Build.hx b/build/Build.hx index 613001bf..5d24b7e7 100644 --- a/build/Build.hx +++ b/build/Build.hx @@ -1,6 +1,12 @@ import haxe.Timer; +/** + helper class to build everything, avoids `--next` +**/ class Build { + /** + run all build files + **/ public static function main() { callLix("build.hxml", "run.n"); callLix("buildDebug.hxml", "runD.n"); @@ -9,6 +15,9 @@ class Build { callLix("buildTest.hxml", "Unittests"); } + /** + perform lix call and take build times + **/ public static function callLix(buildFile:String, title:String) { var startTime = Timer.stamp(); Sys.command("npx", ["haxe", buildFile]); diff --git a/buildTest.hxml b/buildTest.hxml index 9ff45fed..6f0878c2 100644 --- a/buildTest.hxml +++ b/buildTest.hxml @@ -7,6 +7,6 @@ buildGlobal.hxml -x TestMain --macro mcover.MCover.coverage(['checkstyle'], ['src'], ['checkstyle.reporter', 'checkstyle.Main']) --cmd neko run -s src -s test -s schema -p resources/static-analysis.txt +-cmd neko run -s src -s test -s schema -s build -p resources/static-analysis.txt -cmd neko run --default-config resources/default-config.json -cmd neko run -c resources/default-config.json \ No newline at end of file From 3f3539350c0697e8b32e43b2720ab05cf9038fd9 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 18:54:25 +0200 Subject: [PATCH 13/14] fixed incomplete doc comment --- build/Build.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/Build.hx b/build/Build.hx index 5d24b7e7..73227ce3 100644 --- a/build/Build.hx +++ b/build/Build.hx @@ -17,6 +17,9 @@ class Build { /** perform lix call and take build times + + @param buildFile HXML build file + @param title description to use when printing build time **/ public static function callLix(buildFile:String, title:String) { var startTime = Timer.stamp(); From c5026a8e28650e88cd841a30bcc73e90205982b8 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 15 Oct 2019 19:03:40 +0200 Subject: [PATCH 14/14] remove gruntfile and use BlockBreakingConditional check --- checkstyle.json | 7 ++++-- gruntfile.js | 57 ------------------------------------------------- 2 files changed, 5 insertions(+), 59 deletions(-) delete mode 100644 gruntfile.js diff --git a/checkstyle.json b/checkstyle.json index 893dc6cf..a46878d9 100644 --- a/checkstyle.json +++ b/checkstyle.json @@ -11,7 +11,10 @@ }, { "type": "AvoidStarImport" - }, + }, + { + "type": "BlockBreakingConditional" + }, { "props": { "format": "^(e)$" @@ -153,7 +156,7 @@ "character": "tab" }, "type": "IndentationCharacter" - }, + }, { "type": "InnerAssignment" }, diff --git a/gruntfile.js b/gruntfile.js deleted file mode 100644 index 15a26003..00000000 --- a/gruntfile.js +++ /dev/null @@ -1,57 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - shell: { - libs: { - command: "haxelib install haxeparser 3.3.0 && " + - "haxelib install hxargs 3.0.2 && " + - "haxelib install compiletime 2.6.0 && " + - "haxelib install mcover 2.1.1 && " + - "haxelib install munit && " + - "haxelib install tokentree" - } - }, - haxe: haxeOptions(), - zip: zipIt() - }); - - grunt.loadNpmTasks("grunt-haxe"); - grunt.loadNpmTasks("grunt-zip"); - grunt.loadNpmTasks("grunt-shell"); - grunt.registerTask("default", ["shell", "haxe:all"]); -}; - -function haxeOptions() { - return { - all: { - hxml: "buildAll.hxml" - }, - build: { - hxml: "build.hxml" - }, - test: { - hxml: "buildTest.hxml" - }, - debug: { - hxml: "buildDebug.hxml" - }, - telemetry: { - hxml: "buildTelemetry.hxml" - } - }; -} - -function zipIt() { - return { - release: { - src: [ - "src/**", - "resources/sample-config.json", "resources/logo.png", "resources/codeclimate_pr.png", - "haxelib.json", "run.n", "haxecheckstyle.js", "README.md", "CHANGELOG.md", "LICENSE.md" - ], - dest: "haxe-checkstyle.zip", - compression: "DEFLATE", - } - }; -} \ No newline at end of file