eolang 0.34.0 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.markdownlint.json +6 -0
- package/Formula/eolang.rb +2 -2
- package/Formula/eolang@0.32.0.rb +2 -2
- package/Formula/eolang@0.32.1.rb +2 -2
- package/Formula/eolang@0.33.0.rb +2 -2
- package/README.md +7 -3
- package/eslint.config.js +1 -1
- package/mvnw/dependency-reduced-pom.xml +2 -2
- package/mvnw/pom.xml +2 -2
- package/package.json +2 -2
- package/src/commands/assemble.js +11 -1
- package/src/commands/java/compile.js +11 -2
- package/src/commands/java/link.js +11 -1
- package/src/commands/java/pipeline.js +36 -0
- package/src/commands/java/resolve.js +11 -4
- package/src/commands/java/transpile.js +11 -1
- package/src/commands/js/pipeline.js +23 -0
- package/src/commands/js/transpile.js +1 -1
- package/src/commands/lint.js +29 -8
- package/src/commands/parse.js +12 -1
- package/src/commands/register.js +12 -1
- package/src/eoc.js +34 -53
- package/src/mvnw.js +13 -7
- package/src/version.js +2 -2
package/Formula/eolang.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.34.0.tar.gz"
|
|
11
11
|
version "0.33.1"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "d29276ab1c51ac3195fd10fb9578c86851bfc2f49a3a6cce6c2d1c3adb72e7aa"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.32.0.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.34.0.tar.gz"
|
|
11
11
|
version "0.32.0"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "d29276ab1c51ac3195fd10fb9578c86851bfc2f49a3a6cce6c2d1c3adb72e7aa"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.32.1.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.34.0.tar.gz"
|
|
11
11
|
version "0.32.1"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "d29276ab1c51ac3195fd10fb9578c86851bfc2f49a3a6cce6c2d1c3adb72e7aa"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.33.0.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.34.0.tar.gz"
|
|
11
11
|
version "0.33.0"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "d29276ab1c51ac3195fd10fb9578c86851bfc2f49a3a6cce6c2d1c3adb72e7aa"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/README.md
CHANGED
|
@@ -19,14 +19,14 @@ First, you install [npm][npm-install] and [Java SE][java-se].
|
|
|
19
19
|
Then, you install [eolang][npm] package, using [npm][npm-install]:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install -g eolang@0.
|
|
22
|
+
npm install -g eolang@0.34.0
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
You can also use [Homebrew] (on macOS):
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
brew tap objectionary/eoc https://github.com/objectionary/eoc
|
|
29
|
-
brew install objectionary/eoc/eolang@0.
|
|
29
|
+
brew install objectionary/eoc/eolang@0.34.0
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Or install it via [Nix flakes](https://nixos.wiki/wiki/Flakes):
|
|
@@ -35,7 +35,9 @@ Or install it via [Nix flakes](https://nixos.wiki/wiki/Flakes):
|
|
|
35
35
|
nix run github:objectionary/eoc
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
<details>
|
|
39
|
+
|
|
40
|
+
<summary>You can also include EOLANG in your own flake</summary>
|
|
39
41
|
|
|
40
42
|
```nix
|
|
41
43
|
{
|
|
@@ -87,6 +89,8 @@ After that, select one of the methods for installing the package:
|
|
|
87
89
|
}
|
|
88
90
|
```
|
|
89
91
|
|
|
92
|
+
</details>
|
|
93
|
+
|
|
90
94
|
Then, you write a simple [EO](https://www.eolang.org) program in `hello.eo` file
|
|
91
95
|
in the current directory:
|
|
92
96
|
|
package/eslint.config.js
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</plugin>
|
|
80
80
|
<plugin>
|
|
81
81
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
82
|
-
<version>3.5.
|
|
82
|
+
<version>3.5.5</version>
|
|
83
83
|
<configuration>
|
|
84
84
|
<skipTests>true</skipTests>
|
|
85
85
|
</configuration>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
</plugin>
|
|
125
125
|
<plugin>
|
|
126
126
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
127
|
-
<version>3.5.
|
|
127
|
+
<version>3.5.5</version>
|
|
128
128
|
<configuration>
|
|
129
129
|
<skipTests>false</skipTests>
|
|
130
130
|
<failIfNoTests>true</failIfNoTests>
|
package/mvnw/pom.xml
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
</plugin>
|
|
101
101
|
<plugin>
|
|
102
102
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
103
|
-
<version>3.5.
|
|
103
|
+
<version>3.5.5</version>
|
|
104
104
|
<configuration>
|
|
105
105
|
<skipTests>true</skipTests>
|
|
106
106
|
</configuration>
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
</plugin>
|
|
165
165
|
<plugin>
|
|
166
166
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
167
|
-
<version>3.5.
|
|
167
|
+
<version>3.5.5</version>
|
|
168
168
|
<configuration>
|
|
169
169
|
<skipTests>false</skipTests>
|
|
170
170
|
<failIfNoTests>true</failIfNoTests>
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"grunt-mocha-cli": "^7.0.0",
|
|
29
29
|
"istanbul": "^0.4.5",
|
|
30
30
|
"mocha": "^11.7.5",
|
|
31
|
-
"nyc": "^
|
|
31
|
+
"nyc": "^18.0.0",
|
|
32
32
|
"patch-package": "^8.0.0"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"postinstall": "node scripts/postinstall.js",
|
|
75
75
|
"test": "mocha 'test/**/*.js' --timeout 1200000"
|
|
76
76
|
},
|
|
77
|
-
"version": "0.34.
|
|
77
|
+
"version": "0.34.1"
|
|
78
78
|
}
|
package/src/commands/assemble.js
CHANGED
|
@@ -16,8 +16,18 @@ const {elapsed} = require('../elapsed');
|
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
const target = path.resolve(opts.target);
|
|
18
18
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
19
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
20
|
tracked.print(`EO program assembled in ${rel(target)}`);
|
|
21
21
|
return r;
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for assemble command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for assemble command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['eo:assemble'];
|
|
33
|
+
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* SPDX-FileCopyrightText: Copyright (c) 2022-2026 Objectionary.com
|
|
3
3
|
* SPDX-License-Identifier: MIT
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
const rel = require('relative');
|
|
7
6
|
const {mvnw, flags} = require('../../mvnw');
|
|
8
7
|
const {elapsed} = require('../../elapsed');
|
|
@@ -16,8 +15,18 @@ const path = require('path');
|
|
|
16
15
|
module.exports = function(opts) {
|
|
17
16
|
const target = path.resolve(opts.target);
|
|
18
17
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
18
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
19
|
tracked.print(`Java .class files compiled in ${rel(target)}`);
|
|
21
20
|
return r;
|
|
22
21
|
});
|
|
23
22
|
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Method to get Maven goals for compile command.
|
|
26
|
+
* @return {Array.<String>} of Maven goals to run for compile command
|
|
27
|
+
*/
|
|
28
|
+
module.exports.goals = goals;
|
|
29
|
+
|
|
30
|
+
function goals() {
|
|
31
|
+
return ['test-compile'];
|
|
32
|
+
}
|
|
@@ -16,8 +16,18 @@ const path = require('path');
|
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
const jar = path.resolve(opts.target, 'eoc.jar');
|
|
18
18
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
19
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
20
|
tracked.print(`Executable JAR created at ${rel(jar)}`);
|
|
21
21
|
return r;
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for link command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for link command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['jar:jar', 'shade:shade'];
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026 Objectionary.com
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const {mvnw, flags} = require('../../mvnw');
|
|
7
|
+
const {elapsed} = require('../../elapsed');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Runs multiple Maven goals in a single Maven invocation.
|
|
11
|
+
* @param {Object} coms - Command map to resolve goals and extra flags from
|
|
12
|
+
* @param {Array.<String>} commands - Command names to run in order
|
|
13
|
+
* @param {Object} opts - All options
|
|
14
|
+
* @return {Promise} of pipeline task
|
|
15
|
+
*/
|
|
16
|
+
module.exports = function(coms, commands, opts, maven = mvnw) {
|
|
17
|
+
return elapsed(async (tracked) => {
|
|
18
|
+
const {goals, extras} = collect(coms, commands, opts);
|
|
19
|
+
const result = await maven(goals.concat(flags(opts)).concat(extras), opts.target, opts.batch);
|
|
20
|
+
tracked.print(`Pipeline [${commands.join(' \u2192 ')}] done`);
|
|
21
|
+
return result;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function collect(coms, commands, opts) {
|
|
26
|
+
const extras = [];
|
|
27
|
+
const goals = commands.flatMap((cmd) => {
|
|
28
|
+
const command = coms[cmd];
|
|
29
|
+
if (command.extras) {
|
|
30
|
+
extras.push(...command.extras(opts));
|
|
31
|
+
}
|
|
32
|
+
return command.goals(opts) || [];
|
|
33
|
+
});
|
|
34
|
+
return {goals, extras};
|
|
35
|
+
};
|
|
36
|
+
|
|
@@ -15,12 +15,19 @@ const path = require('path');
|
|
|
15
15
|
*/
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
return elapsed(async (tracked) => {
|
|
18
|
-
await mvnw(
|
|
19
|
-
const sources = path.resolve(opts.target, 'eo/6-resolve');
|
|
20
|
-
console.info('Dependencies resolved in %s', rel(sources));
|
|
21
|
-
const r = await mvnw(['eo:place'].concat(flags(opts)), opts.target, opts.batch);
|
|
18
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
22
19
|
const classes = path.resolve(opts.target, 'classes');
|
|
23
20
|
tracked.print(`Dependencies placed in ${rel(classes)}`);
|
|
24
21
|
return r;
|
|
25
22
|
});
|
|
26
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for resolve command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for resolve command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['eo:resolve', 'eo:place'];
|
|
33
|
+
}
|
|
@@ -16,8 +16,18 @@ const path = require('path');
|
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
const sources = path.resolve(opts.target, 'generated-sources');
|
|
18
18
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
19
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
20
|
tracked.print(`Java sources generated in ${rel(sources)}`);
|
|
21
21
|
return r;
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for transpile command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for transpile command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['eo:transpile'];
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026 Objectionary.com
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const {elapsed} = require('../../elapsed');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Runs multiple JS pipeline steps sequentially.
|
|
10
|
+
* @param {Object} coms - Command map to resolve step functions from
|
|
11
|
+
* @param {Array.<String>} commands - Command names to run in order
|
|
12
|
+
* @param {Object} opts - All options
|
|
13
|
+
* @return {Promise} of pipeline task
|
|
14
|
+
*/
|
|
15
|
+
module.exports = function(coms, commands, opts) {
|
|
16
|
+
return elapsed(async (tracked) => {
|
|
17
|
+
for (const cmd of commands) {
|
|
18
|
+
// eslint-disable-next-line no-await-in-loop
|
|
19
|
+
await coms[cmd](opts);
|
|
20
|
+
}
|
|
21
|
+
tracked.print(`Pipeline [${commands.join(' \u2192 ')}] done`);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -15,7 +15,7 @@ const path = require('path');
|
|
|
15
15
|
*/
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
return elapsed(async (tracked) => {
|
|
18
|
-
const r = await eo2jsw('transpile', {
|
|
18
|
+
const r = await eo2jsw('transpile', {...opts, alone: true, project: 'project'});
|
|
19
19
|
tracked.print(`JS sources generated in ${rel(path.resolve(opts.target, 'project'))}`);
|
|
20
20
|
return r;
|
|
21
21
|
});
|
package/src/commands/lint.js
CHANGED
|
@@ -15,14 +15,12 @@ const semver = require('semver');
|
|
|
15
15
|
* @return {Promise} of assemble task
|
|
16
16
|
*/
|
|
17
17
|
module.exports = function(opts) {
|
|
18
|
-
const extra =
|
|
19
|
-
`-Deo.failOnWarning=${opts.easy ? 'false' : 'true'}`,
|
|
20
|
-
];
|
|
18
|
+
const extra = extraFlags(opts);
|
|
21
19
|
return elapsed(async (tracked) => {
|
|
22
|
-
if (opts
|
|
20
|
+
if (goals(opts)[0] === 'eo:lint') {
|
|
23
21
|
try {
|
|
24
22
|
const r = await mvnw(
|
|
25
|
-
|
|
23
|
+
goals(opts).concat(flags(opts)).concat(extra),
|
|
26
24
|
opts.target, opts.batch
|
|
27
25
|
);
|
|
28
26
|
tracked.print(`EO program linted in ${rel(path.resolve(opts.target))}`);
|
|
@@ -30,13 +28,13 @@ module.exports = function(opts) {
|
|
|
30
28
|
} catch (error) {
|
|
31
29
|
throw new Error(
|
|
32
30
|
'There are errors and/or warnings; you may disable warnings via the --easy option',
|
|
33
|
-
{
|
|
31
|
+
{cause: error}
|
|
34
32
|
);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
try {
|
|
38
36
|
const r = await mvnw(
|
|
39
|
-
|
|
37
|
+
goals(opts).concat(flags(opts)).concat(extra),
|
|
40
38
|
opts.target, opts.batch
|
|
41
39
|
);
|
|
42
40
|
tracked.print(`EO program verified in ${rel(path.resolve(opts.target))}`);
|
|
@@ -44,8 +42,31 @@ module.exports = function(opts) {
|
|
|
44
42
|
} catch (error) {
|
|
45
43
|
throw new Error(
|
|
46
44
|
'You may disable warnings via the --easy option',
|
|
47
|
-
{
|
|
45
|
+
{cause: error}
|
|
48
46
|
);
|
|
49
47
|
}
|
|
50
48
|
});
|
|
51
49
|
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Command to get Maven goals for lint command.
|
|
53
|
+
* @return {Array.<String>} of Maven goals to run for lint command
|
|
54
|
+
*/
|
|
55
|
+
module.exports.goals = goals;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Command to get extra Maven flags for lint command.
|
|
59
|
+
* @return {Array.<String>} of extra Maven flags to run for lint command
|
|
60
|
+
*/
|
|
61
|
+
module.exports.extras = extras;
|
|
62
|
+
|
|
63
|
+
function goals(opts) {
|
|
64
|
+
if (opts.parser.endsWith('-SNAPSHOT') || semver.gte(opts.parser, '0.45.0')) {
|
|
65
|
+
return ['eo:lint'];
|
|
66
|
+
}
|
|
67
|
+
return ['eo:verify'];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function extras(opts) {
|
|
71
|
+
return [`-Deo.failOnWarning=${opts.easy ? 'false' : 'true'}`];
|
|
72
|
+
}
|
package/src/commands/parse.js
CHANGED
|
@@ -16,8 +16,19 @@ const {elapsed} = require('../elapsed');
|
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
const target = path.resolve(opts.target);
|
|
18
18
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
19
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
20
|
tracked.print(`EO sources parsed in ${rel(target)}`);
|
|
21
21
|
return r;
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for parse command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for parse command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['eo:parse'];
|
|
33
|
+
}
|
|
34
|
+
|
package/src/commands/register.js
CHANGED
|
@@ -16,8 +16,19 @@ const path = require('path');
|
|
|
16
16
|
module.exports = function(opts) {
|
|
17
17
|
const foreign = path.resolve(opts.target, 'eo-foreign.json');
|
|
18
18
|
return elapsed(async (tracked) => {
|
|
19
|
-
const r = await mvnw(
|
|
19
|
+
const r = await mvnw(goals().concat(flags(opts)), opts.target, opts.batch);
|
|
20
20
|
tracked.print(`EO objects registered in ${rel(foreign)}`);
|
|
21
21
|
return r;
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Command to get Maven goals for register command.
|
|
27
|
+
* @return {Array.<String>} of Maven goals to run for register command
|
|
28
|
+
*/
|
|
29
|
+
module.exports.goals = goals;
|
|
30
|
+
|
|
31
|
+
function goals() {
|
|
32
|
+
return ['eo:register'];
|
|
33
|
+
}
|
|
34
|
+
|
package/src/eoc.js
CHANGED
|
@@ -32,7 +32,7 @@ const {program} = require('commander'),
|
|
|
32
32
|
generate_comments: require('./commands/generate_comments'),
|
|
33
33
|
jeo_disassemble: require('./commands/jeo/disassemble'),
|
|
34
34
|
jeo_assemble: require('./commands/jeo/assemble'),
|
|
35
|
-
latex: require('./commands/latex')
|
|
35
|
+
latex: require('./commands/latex'),
|
|
36
36
|
},
|
|
37
37
|
commands = {
|
|
38
38
|
[language.java]: {
|
|
@@ -43,7 +43,7 @@ const {program} = require('commander'),
|
|
|
43
43
|
link: require('./commands/java/link'),
|
|
44
44
|
compile: require('./commands/java/compile'),
|
|
45
45
|
dataize: require('./commands/java/dataize'),
|
|
46
|
-
test: require('./commands/java/test')
|
|
46
|
+
test: require('./commands/java/test'),
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
[language.js]: {
|
|
@@ -54,9 +54,13 @@ const {program} = require('commander'),
|
|
|
54
54
|
link: require('./commands/js/link'),
|
|
55
55
|
compile: require('./commands/js/compile'),
|
|
56
56
|
dataize: require('./commands/js/dataize'),
|
|
57
|
-
test: require('./commands/js/test')
|
|
57
|
+
test: require('./commands/js/test'),
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
},
|
|
61
|
+
pipelines = {
|
|
62
|
+
[language.java]: require('./commands/java/pipeline'),
|
|
63
|
+
[language.js]: require('./commands/js/pipeline'),
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
if (process.argv.includes('--verbose')) {
|
|
@@ -106,7 +110,8 @@ program
|
|
|
106
110
|
.option('-c, --clean', 'Delete .eoc directory before running a command')
|
|
107
111
|
.option('--debug', 'Print ALL debug messages, heavily overloading the log')
|
|
108
112
|
.option('--verbose', 'Print debug messages and full output of child processes')
|
|
109
|
-
.option('--pin <version>', 'Fail if eoc version doesn\'t match exactly', version.what)
|
|
113
|
+
.option('--pin <version>', 'Fail if eoc version doesn\'t match exactly', version.what)
|
|
114
|
+
.option('--update-snapshots', 'Update snapshots in the local repository if they are outdated');
|
|
110
115
|
|
|
111
116
|
program.command('audit')
|
|
112
117
|
.description('Inspect all packages and report their status')
|
|
@@ -142,8 +147,7 @@ program.command('parse')
|
|
|
142
147
|
pin(program.opts());
|
|
143
148
|
clear(str);
|
|
144
149
|
if (program.opts().alone === undefined) {
|
|
145
|
-
await coms()
|
|
146
|
-
await coms().parse(program.opts());
|
|
150
|
+
await pipe()(coms(), ['register', 'parse'], program.opts());
|
|
147
151
|
} else {
|
|
148
152
|
await coms().parse(program.opts());
|
|
149
153
|
}
|
|
@@ -155,8 +159,7 @@ program.command('assemble')
|
|
|
155
159
|
pin(program.opts());
|
|
156
160
|
clear(str);
|
|
157
161
|
if (program.opts().alone === undefined) {
|
|
158
|
-
await coms()
|
|
159
|
-
await coms().assemble(program.opts());
|
|
162
|
+
await pipe()(coms(), ['register', 'assemble'], program.opts());
|
|
160
163
|
} else {
|
|
161
164
|
await coms().assemble(program.opts());
|
|
162
165
|
}
|
|
@@ -174,8 +177,7 @@ program.command('sodg')
|
|
|
174
177
|
pin(program.opts());
|
|
175
178
|
clear(str);
|
|
176
179
|
if (program.opts().alone === undefined) {
|
|
177
|
-
await coms()
|
|
178
|
-
await coms().assemble(program.opts());
|
|
180
|
+
await pipe()(coms(), ['register', 'assemble'], program.opts());
|
|
179
181
|
await coms().sodg({...program.opts(), ...str});
|
|
180
182
|
} else {
|
|
181
183
|
await coms().sodg({...program.opts(), ...str});
|
|
@@ -206,9 +208,7 @@ program.command('lint')
|
|
|
206
208
|
pin(program.opts());
|
|
207
209
|
clear(str);
|
|
208
210
|
if (program.opts().alone === undefined) {
|
|
209
|
-
await coms()
|
|
210
|
-
await coms().assemble(program.opts());
|
|
211
|
-
await coms().lint(program.opts());
|
|
211
|
+
await pipe()(coms(), ['register', 'assemble', 'lint'], program.opts());
|
|
212
212
|
} else {
|
|
213
213
|
await coms().lint(program.opts());
|
|
214
214
|
}
|
|
@@ -220,10 +220,7 @@ program.command('resolve')
|
|
|
220
220
|
pin(program.opts());
|
|
221
221
|
clear(str);
|
|
222
222
|
if (program.opts().alone === undefined) {
|
|
223
|
-
await coms()
|
|
224
|
-
await coms().assemble(program.opts());
|
|
225
|
-
await coms().lint(program.opts());
|
|
226
|
-
await coms().resolve(program.opts());
|
|
223
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve'], program.opts());
|
|
227
224
|
} else {
|
|
228
225
|
await coms().resolve(program.opts());
|
|
229
226
|
}
|
|
@@ -235,11 +232,7 @@ program.command('transpile')
|
|
|
235
232
|
pin(program.opts());
|
|
236
233
|
clear(str);
|
|
237
234
|
if (program.opts().alone === undefined) {
|
|
238
|
-
await coms()
|
|
239
|
-
await coms().assemble(program.opts());
|
|
240
|
-
await coms().lint(program.opts());
|
|
241
|
-
await coms().resolve(program.opts());
|
|
242
|
-
await coms().transpile(program.opts());
|
|
235
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve', 'transpile'], program.opts());
|
|
243
236
|
} else {
|
|
244
237
|
await coms().transpile(program.opts());
|
|
245
238
|
}
|
|
@@ -251,12 +244,7 @@ program.command('compile')
|
|
|
251
244
|
pin(program.opts());
|
|
252
245
|
clear(str);
|
|
253
246
|
if (program.opts().alone === undefined) {
|
|
254
|
-
await coms()
|
|
255
|
-
await coms().assemble(program.opts());
|
|
256
|
-
await coms().lint(program.opts());
|
|
257
|
-
await coms().resolve(program.opts());
|
|
258
|
-
await coms().transpile(program.opts());
|
|
259
|
-
await coms().compile(program.opts());
|
|
247
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve', 'transpile', 'compile'], program.opts());
|
|
260
248
|
} else {
|
|
261
249
|
await coms().compile(program.opts());
|
|
262
250
|
}
|
|
@@ -267,13 +255,7 @@ program.command('link')
|
|
|
267
255
|
.action(async (str, opts) => {
|
|
268
256
|
clear(str);
|
|
269
257
|
if (program.opts().alone === undefined) {
|
|
270
|
-
await coms()
|
|
271
|
-
await coms().assemble(program.opts());
|
|
272
|
-
await coms().lint(program.opts());
|
|
273
|
-
await coms().resolve(program.opts());
|
|
274
|
-
await coms().transpile(program.opts());
|
|
275
|
-
await coms().compile(program.opts());
|
|
276
|
-
await coms().link(program.opts());
|
|
258
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve', 'transpile', 'compile', 'link'], program.opts());
|
|
277
259
|
} else {
|
|
278
260
|
await coms().link(program.opts());
|
|
279
261
|
}
|
|
@@ -287,13 +269,7 @@ program.command('dataize')
|
|
|
287
269
|
pin(program.opts());
|
|
288
270
|
clear(str);
|
|
289
271
|
if (program.opts().alone === undefined) {
|
|
290
|
-
await coms()
|
|
291
|
-
await coms().assemble(program.opts());
|
|
292
|
-
await coms().lint(program.opts());
|
|
293
|
-
await coms().resolve(program.opts());
|
|
294
|
-
await coms().transpile(program.opts());
|
|
295
|
-
await coms().compile(program.opts());
|
|
296
|
-
await coms().link(program.opts());
|
|
272
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve', 'transpile', 'compile', 'link'], program.opts());
|
|
297
273
|
await coms().dataize(
|
|
298
274
|
program.args[1], program.args.slice(2), {...program.opts(), ...str}
|
|
299
275
|
);
|
|
@@ -312,13 +288,7 @@ program.command('test')
|
|
|
312
288
|
pin(program.opts());
|
|
313
289
|
clear(str);
|
|
314
290
|
if (program.opts().alone === undefined) {
|
|
315
|
-
await coms()
|
|
316
|
-
await coms().assemble(program.opts());
|
|
317
|
-
await coms().lint(program.opts());
|
|
318
|
-
await coms().resolve(program.opts());
|
|
319
|
-
await coms().transpile(program.opts());
|
|
320
|
-
await coms().compile(program.opts());
|
|
321
|
-
await coms().link(program.opts());
|
|
291
|
+
await pipe()(coms(), ['register', 'assemble', 'lint', 'resolve', 'transpile', 'compile', 'link'], program.opts());
|
|
322
292
|
await coms().test({...program.opts(), ...str});
|
|
323
293
|
} else {
|
|
324
294
|
await coms().test({...program.opts(), ...str});
|
|
@@ -397,8 +367,7 @@ program.command('latex')
|
|
|
397
367
|
.action(async (str, opts) => {
|
|
398
368
|
pin(program.opts());
|
|
399
369
|
clear(str);
|
|
400
|
-
await coms()
|
|
401
|
-
await coms().parse(program.opts());
|
|
370
|
+
await pipe()(coms(), ['register', 'parse'], program.opts());
|
|
402
371
|
await coms().latex(program.opts());
|
|
403
372
|
});
|
|
404
373
|
|
|
@@ -407,8 +376,7 @@ program.command('fmt')
|
|
|
407
376
|
.action(async (str, opts) => {
|
|
408
377
|
pin(program.opts());
|
|
409
378
|
clear(str);
|
|
410
|
-
await coms()
|
|
411
|
-
await coms().parse(program.opts());
|
|
379
|
+
await pipe()(coms(), ['register', 'parse'], program.opts());
|
|
412
380
|
await coms().print({
|
|
413
381
|
printInput: '1-parse',
|
|
414
382
|
printOutput: program.opts().sources,
|
|
@@ -457,3 +425,16 @@ function coms() {
|
|
|
457
425
|
}
|
|
458
426
|
return hash;
|
|
459
427
|
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Get pipeline for the target language.
|
|
431
|
+
* @return {Function} - pipeline function
|
|
432
|
+
*/
|
|
433
|
+
function pipe() {
|
|
434
|
+
const lang = program.opts().language;
|
|
435
|
+
const pipeline = pipelines[lang];
|
|
436
|
+
if (pipeline === undefined) {
|
|
437
|
+
throw new Error(`Unknown platform ${lang}`);
|
|
438
|
+
}
|
|
439
|
+
return pipeline;
|
|
440
|
+
}
|
package/src/mvnw.js
CHANGED
|
@@ -7,7 +7,7 @@ const path = require('path');
|
|
|
7
7
|
const fs = require('fs');
|
|
8
8
|
const rel = require('relative');
|
|
9
9
|
const readline = require('readline');
|
|
10
|
-
const {
|
|
10
|
+
const {spawn} = require('child_process');
|
|
11
11
|
const colors = require('colors');
|
|
12
12
|
const parserVersion = require('./parser-version');
|
|
13
13
|
|
|
@@ -31,7 +31,13 @@ let beginning,
|
|
|
31
31
|
* @param {Object} opts - Opts provided to the "eoc"
|
|
32
32
|
* @return {Array} of Maven options
|
|
33
33
|
*/
|
|
34
|
-
module.exports.flags = function
|
|
34
|
+
module.exports.flags = function(opts) {
|
|
35
|
+
if (opts.sources === undefined) {
|
|
36
|
+
throw new Error('Sources directory is not specified. Please provide it with --sources option.');
|
|
37
|
+
}
|
|
38
|
+
if (opts.target === undefined) {
|
|
39
|
+
throw new Error('Target directory is not specified. Please provide it with --target option.');
|
|
40
|
+
}
|
|
35
41
|
const sources = path.resolve(opts.sources);
|
|
36
42
|
console.debug('Sources in %s', rel(sources));
|
|
37
43
|
const target = path.resolve(opts.target);
|
|
@@ -50,6 +56,7 @@ module.exports.flags = function (opts) {
|
|
|
50
56
|
opts.verbose ? '--errors' : '',
|
|
51
57
|
opts.verbose ? '' : '--quiet',
|
|
52
58
|
opts.debug ? '--debug' : '',
|
|
59
|
+
opts.updateSnapshots ? '--update-snapshots' : '',
|
|
53
60
|
`-Deo.sourcesDir=${sources}`,
|
|
54
61
|
`-Deo.targetDir=${target}`,
|
|
55
62
|
`-Deo.outputDir=${path.resolve(opts.target, 'classes')}`,
|
|
@@ -58,7 +65,7 @@ module.exports.flags = function (opts) {
|
|
|
58
65
|
`-Deo.placedFormat=csv`,
|
|
59
66
|
`-Deo.skipLinting=${opts.blind ? 'true' : 'false'}`,
|
|
60
67
|
opts.trackTransformationSteps ? '-Deo.trackTransformationSteps' : '',
|
|
61
|
-
];
|
|
68
|
+
].filter(flag => flag !== '');
|
|
62
69
|
};
|
|
63
70
|
|
|
64
71
|
/**
|
|
@@ -68,11 +75,11 @@ module.exports.flags = function (opts) {
|
|
|
68
75
|
* @param {Boolean} [batch] - Is it batch mode (TRUE) or interactive (FALSE)?
|
|
69
76
|
* @return {Promise} of maven execution task
|
|
70
77
|
*/
|
|
71
|
-
module.exports.mvnw = function
|
|
78
|
+
module.exports.mvnw = function(args, tgt, batch) {
|
|
72
79
|
return new Promise((resolve, reject) => {
|
|
73
80
|
console.debug(`Running mvnw with arguments: ${args.join(' ')}`);
|
|
74
81
|
target = tgt;
|
|
75
|
-
phase = args
|
|
82
|
+
phase = args.filter((a) => !a.startsWith('-')).join(' + ');
|
|
76
83
|
const home = path.resolve(__dirname, '../mvnw');
|
|
77
84
|
let bin = path.resolve(home, 'mvnw') + (process.platform === 'win32' ? '.cmd' : '');
|
|
78
85
|
if (!fs.existsSync(bin)) {
|
|
@@ -82,7 +89,6 @@ module.exports.mvnw = function (args, tgt, batch) {
|
|
|
82
89
|
const params = args.filter((t) => t !== '').concat([
|
|
83
90
|
'--batch-mode',
|
|
84
91
|
'--color=never',
|
|
85
|
-
'--update-snapshots',
|
|
86
92
|
'--fail-fast',
|
|
87
93
|
'--strict-checksums',
|
|
88
94
|
]);
|
|
@@ -129,7 +135,7 @@ module.exports.mvnw = function (args, tgt, batch) {
|
|
|
129
135
|
function start() {
|
|
130
136
|
running = true;
|
|
131
137
|
beginning = Date.now();
|
|
132
|
-
const check = function
|
|
138
|
+
const check = function() {
|
|
133
139
|
if (running) {
|
|
134
140
|
print();
|
|
135
141
|
setTimeout(check, 1000);
|
package/src/version.js
CHANGED