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

reenable jvm target #498

Merged
merged 10 commits into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/checkstyle-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
mv haxe3_libraries haxe_libraries
- name: Run lix download
run: npx lix download
- name: Fix haxeshim for "-x"
run: ./fixHaxeshim.sh
- name: Print versions
run: |
npx haxe -version
Expand All @@ -62,12 +64,15 @@ jobs:
run: npx haxe buildSchema.hxml
- name: Run neko tests
if: matrix.haxe-version == '3.4.7'
run: npx haxe -D codecov_json buildTest.hxml
run: npx haxe -D codecov_json testAndResources.hxml
- name: Run eval tests
if: matrix.haxe-version != '3.4.7'
run: npx haxe -D codecov_json buildTest.hxml
run: npx haxe -D codecov_json testAndResources.hxml
- name: Run Java tests
run: npx haxe testJava.hxml
- name: Run Jvm tests
if: matrix.haxe-version != '3.4.7'
run: npx haxe testJvm.hxml
- name: Format and upload codeclimate coverage
if: success() && matrix.haxe-version == '4.0.5'
run: |
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install:
- if [[ "$HAXE_VERSION" == "haxe4" ]]; then npx lix download haxe 4.0.5; npx lix use haxe 4.0.5; fi
- if [[ "$HAXE_VERSION" == "nightly" ]]; then npx lix download haxe nightly; npx lix use haxe nightly; fi
- npx lix download
- ./fixHaxeshim.sh
- npx haxe -version
- npx neko -version
- npx haxelib list
Expand All @@ -33,8 +34,9 @@ script:
- npx haxe buildJS.hxml
- if [[ "$HAXE_VERSION" != "nightly" ]]; then npx haxe buildCpp.hxml; fi
- npx haxe buildSchema.hxml
- npx haxe -D codecov_json buildTest.hxml
- npx haxe -D codecov_json testAndResources.hxml
- npx haxe testJava.hxml
- if [[ "$HAXE_VERSION" != "haxe347" ]]; then npx haxe testJvm.hxml; fi
- (cd src; ../cc-test-reporter format-coverage -t lcov ../lcov.info)

after_script:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Added support for final in `MagicNumber`, fixes [#494](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/494) ([#495](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/495))
- Fixed handling `OBJECT_DECL` token in `RightCurly`, fixes [#496](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/496) ([#497](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/497))
- Reorganised build files ([#498](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/498))

## version 2.6.1 (2019-12-17)

Expand Down
2 changes: 1 addition & 1 deletion build.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
buildGlobal.hxml
build/common.hxml
-main checkstyle.Main
-neko run.n
8 changes: 6 additions & 2 deletions build/Build.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class Build {
callLix("buildDebug.hxml", "runD.n");
callLix("buildJS.hxml", "run.js");
callLix("buildSchema.hxml", "Json schema");
callLix("buildTest.hxml", "Unittests");
callLix("testAndResources.hxml", "Unittests neko / eval + generate resoucres");
callLix("testJava.hxml", "Unittests Java");
#if haxe4
callLix("testJvm.hxml", "Unittests Jvm");
#end
Sys.exit(exitCode);
}

Expand All @@ -27,7 +31,7 @@ class Build {
public static function callLix(buildFile:String, title:String) {
var startTime = Timer.stamp();
var result:Int = Sys.command("npx", ["haxe", buildFile]);
Sys.println('building $title (${Timer.stamp() - startTime})');
Sys.println('building $title (took ${Timer.stamp() - startTime})');
if (result != 0) {
exitCode = result;
}
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions build/commonTest.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build/common.hxml
-cp test
-lib mcover
-lib munit
-lib test-adapter
-D unittest
# -debug
--macro mcover.MCover.coverage(['checkstyle'], ['src'], ['checkstyle.reporter', 'checkstyle.Main'])
2 changes: 1 addition & 1 deletion buildCpp.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildGlobal.hxml
build/common.hxml
# -lib hxcpp-debugger
# -D HXCPP_DEBUGGER

Expand Down
2 changes: 1 addition & 1 deletion buildDebug.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildGlobal.hxml
build/common.hxml
-main checkstyle.Main
-debug
-neko runD.n
2 changes: 1 addition & 1 deletion buildJS.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildGlobal.hxml
build/common.hxml
-lib hxnodejs
-main checkstyle.Main
-js haxecheckstyle.js
2 changes: 1 addition & 1 deletion buildSchema.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
buildGlobal.hxml
build/common.hxml
-cp schema
-x SchemaGenerator
2 changes: 1 addition & 1 deletion buildTelemetry.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildGlobal.hxml
build/common.hxml
-lib hxtelemetry

-D HXCPP_STACK_TRACE
Expand Down
12 changes: 0 additions & 12 deletions buildTest.hxml

This file was deleted.

9 changes: 9 additions & 0 deletions fixHaxeshim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

git clone --depth 1 -b fix_-x https://github.com/AlexHaxe/haxeshim.git

(cd haxeshim; npm i lix; npx lix download; npx haxe all.hxml)

cp haxeshim/bin/*.js node_modules/lix/bin

rm -rf haxeshim
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
],
"devDependencies": {
"lix": "^15.5.4"
"lix": "^15.8.6"
},
"bugs": "https://github.com/HaxeCheckstyle/haxe-checkstyle/issues",
"license": "MIT"
Expand Down
28 changes: 14 additions & 14 deletions resources/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@
"modifier": "PUBLIC",
"requireParams": true,
"requireReturn": true,
"ignoreOverride": true,
"excludeNames": [
"new",
"toString"
],
"ignoreOverride": true
]
}
},
{
Expand Down Expand Up @@ -219,9 +219,9 @@
"props": {
"character": "tab",
"ignoreConditionals": false,
"conditionalPolicy": "aligned",
"ignoreComments": true,
"wrapPolicy": "larger",
"conditionalPolicy": "aligned"
"wrapPolicy": "larger"
}
},
{
Expand Down Expand Up @@ -352,9 +352,9 @@
{
"type": "MultipleStringLiterals",
"props": {
"ignore": "^\\s+$",
"allowDuplicates": 2,
"minLength": 2
"minLength": 2,
"ignore": "^\\s+$"
}
},
{
Expand Down Expand Up @@ -424,7 +424,6 @@
{
"type": "OperatorWrap",
"props": {
"option": "eol",
"tokens": [
"=",
"+",
Expand Down Expand Up @@ -461,7 +460,8 @@
"=>",
"++",
"--"
]
],
"option": "eol"
}
},
{
Expand Down Expand Up @@ -544,17 +544,17 @@
"props": {
"dotPolicy": "none",
"commaPolicy": "after",
"semicolonPolicy": "after",
"allowTrailingComma": false
"allowTrailingComma": false,
"semicolonPolicy": "after"
}
},
{
"type": "SeparatorWrap",
"props": {
"option": "eol",
"tokens": [
","
]
],
"option": "eol"
}
},
{
Expand All @@ -568,13 +568,13 @@
{
"type": "Spacing",
"props": {
"spaceAroundBinop": true,
"noSpaceAroundUnop": true,
"spaceIfCondition": "should",
"spaceForLoop": "should",
"spaceWhileLoop": "should",
"spaceSwitchCase": "should",
"spaceCatch": "should",
"spaceAroundBinop": true,
"noSpaceAroundUnop": true,
"ignoreRangeOperator": true
}
},
Expand Down
14 changes: 0 additions & 14 deletions src/checkstyle/ParserQueue.hx
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
package checkstyle;

#if ((haxe_ver >= 4.0) && (neko || macro || eval || cpp || hl || java))
import sys.thread.Mutex;
import sys.thread.Thread;
#elseif neko
import neko.vm.Mutex;
import neko.vm.Thread;
#elseif cpp
import cpp.vm.Mutex;
import cpp.vm.Thread;
#elseif java
import java.vm.Mutex;
import java.vm.Thread;
#else
import checkstyle.utils.Mutex;
import checkstyle.utils.Thread;
#end

class ParserQueue {
static inline var SLEEP_TIME:Float = 0.1;
Expand Down
10 changes: 0 additions & 10 deletions src/checkstyle/checks/coding/CodeSimilarityCheck.hx
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
package checkstyle.checks.coding;

#if ((haxe_ver >= 4.0) && (neko || macro || eval || cpp || hl || java))
import sys.thread.Mutex;
#elseif neko
import neko.vm.Mutex;
#elseif cpp
import cpp.vm.Mutex;
#elseif java
import java.vm.Mutex;
#else
import checkstyle.utils.Mutex;
#end

/**
Checks for identical or similar code.
Expand Down
12 changes: 1 addition & 11 deletions src/checkstyle/reporter/ReporterManager.hx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
package checkstyle.reporter;

#if ((haxe_ver >= 4.0) && (neko || macro || eval || cpp || hl || java))
import sys.thread.Mutex;
#elseif neko
import neko.vm.Mutex;
#elseif cpp
import cpp.vm.Mutex;
#elseif java
import java.vm.Mutex;
#else
import checkstyle.utils.Mutex;
#end
import checkstyle.CheckMessage;
import checkstyle.checks.Category;
import checkstyle.utils.Mutex;

class ReporterManager {
public static var INSTANCE:ReporterManager = new ReporterManager();
Expand Down
14 changes: 9 additions & 5 deletions src/checkstyle/utils/ConfigUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package checkstyle.utils;

import checkstyle.Checker;
import checkstyle.ChecksInfo.CheckInfo;
import checkstyle.config.Config;
import checkstyle.config.CheckConfig;
import checkstyle.checks.Check;
import checkstyle.config.CheckConfig;
import checkstyle.config.Config;
import haxe.Json;
import haxe.ds.ArraySort;
import sys.io.File;
Expand Down Expand Up @@ -86,15 +86,19 @@ class ConfigUtils {
"messages",
"checker",
"placemap",
"metaName"
"metaName",
"ignoreRE"
];
var checkConfig:CheckConfig = {
type: check.getModuleName(),
props: {}
};
for (prop in Reflect.fields(check)) {
for (prop in Type.getInstanceFields(Type.getClass(check))) {
if (propsNotAllowed.contains(prop)) continue;
Reflect.setField(checkConfig.props, prop, Reflect.field(check, prop));

var value = Reflect.field(check, prop);
if (Reflect.isFunction(value)) continue;
Reflect.setField(checkConfig.props, prop, value);
}
return checkConfig;
}
Expand Down
9 changes: 9 additions & 0 deletions src/checkstyle/utils/DummyMutex.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package checkstyle.utils;

class DummyMutex {
public function new() {}

public function acquire() {}

public function release() {}
}
7 changes: 7 additions & 0 deletions src/checkstyle/utils/DummyThread.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package checkstyle.utils;

class DummyThread {
public static function create(f:Void -> Void) {
f();
}
}
Loading