Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using lix #478

Merged
merged 14 commits into from
Oct 15, 2019
4 changes: 4 additions & 0 deletions .haxerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "4.0.0-rc.5",
"resolveLibs": "scoped"
}
87 changes: 39 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,44 @@
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

env:
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
- 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

before_script:
- ./cc-test-reporter before-build

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
- 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

after_script:
- (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info)
- (cd src; ../cc-test-reporter upload-coverage)

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
after_success:
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## dev branch / next version (2.x.x)

- Refactored build system to use lix ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478))

## 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)
Expand Down
29 changes: 29 additions & 0 deletions build/Build.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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");
callLix("buildJS.hxml", "run.js");
callLix("buildSchema.hxml", "Json schema");
callLix("buildTest.hxml", "Unittests");
}

/**
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();
Sys.command("npx", ["haxe", buildFile]);
Sys.println('building $title (${Timer.stamp() - startTime})');
}
}
19 changes: 2 additions & 17 deletions buildAll.hxml
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
build.hxml

--next

buildDebug.hxml

--next

buildJS.hxml

--next

buildSchema.hxml

--next

buildTest.hxml
-cp build
--run Build
4 changes: 2 additions & 2 deletions buildGlobal.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-cp src
-lib haxeparser
-lib compiletime:2.6.0
-lib hxargs:3.0.2
-lib compiletime
-lib hxargs
-lib tokentree
1 change: 0 additions & 1 deletion buildSchema.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
buildGlobal.hxml
-cp schema
-xml resources/schema.xml
-x SchemaGenerator
2 changes: 0 additions & 2 deletions buildTelemetry.hxml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
buildGlobal.hxml
-lib hxtelemetry

--each

-D HXCPP_STACK_TRACE
-D HXCPP_TELEMETRY

Expand Down
3 changes: 1 addition & 2 deletions buildTest.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -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
7 changes: 5 additions & 2 deletions checkstyle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
},
{
"type": "AvoidStarImport"
},
},
{
"type": "BlockBreakingConditional"
},
{
"props": {
"format": "^(e)$"
Expand Down Expand Up @@ -153,7 +156,7 @@
"character": "tab"
},
"type": "IndentationCharacter"
},
},
{
"type": "InnerAssignment"
},
Expand Down
57 changes: 0 additions & 57 deletions gruntfile.js

This file was deleted.

3 changes: 3 additions & 0 deletions haxe3_libraries/compiletime.hxml
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions haxe3_libraries/haxeparser.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-D haxeparser=3.3.0
# @install: lix --silent download "haxelib:/haxeparser#3.3.0" into haxeparser/3.3.0/haxelib
-lib hxparse
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/haxelib/src
3 changes: 3 additions & 0 deletions haxe3_libraries/hxargs.hxml
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions haxe3_libraries/hxcpp.hxml
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions haxe3_libraries/hxjava.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe3_libraries/hxjsonast.hxml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions haxe3_libraries/hxnodejs.hxml
Original file line number Diff line number Diff line change
@@ -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')
3 changes: 3 additions & 0 deletions haxe3_libraries/hxparse.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-D hxparse=4.0.0
# @install: lix --silent download "haxelib:/hxparse#4.0.0" into hxparse/4.0.0/haxelib
-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/haxelib/src
4 changes: 4 additions & 0 deletions haxe3_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe3_libraries/mconsole.hxml
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions haxe3_libraries/mcover.hxml
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions haxe3_libraries/mlib.hxml
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 6 additions & 0 deletions haxe3_libraries/munit.hxml
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions haxe3_libraries/test-adapter.hxml
Original file line number Diff line number Diff line change
@@ -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()
3 changes: 3 additions & 0 deletions haxe3_libraries/tokentree.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe_libraries/compiletime.hxml
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions haxe_libraries/haxeparser.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe_libraries/hxargs.hxml
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions haxe_libraries/hxcpp.hxml
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions haxe_libraries/hxjava.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe_libraries/hxjsonast.hxml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions haxe_libraries/hxnodejs.hxml
Original file line number Diff line number Diff line change
@@ -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')
3 changes: 3 additions & 0 deletions haxe_libraries/hxparse.hxml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions haxe_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions haxe_libraries/mconsole.hxml
Original file line number Diff line number Diff line change
@@ -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/
Loading