Open Skillzore opened 3 years ago
Yes I guess it's using the frontend's node_modules instead of JSweet's one. As a workaround, I suggest you set ts/js/candies out in the target folder, and copy it after JSweet transpilation
Hmm, okay, could we possibly get gradle to move the files after transpilation?
Does the jsweet plugin have a task to reference? trying to reference the plugin in a move script results in an error. Script:
task jsweetMove() {
dependsOn jsweet
doLast {ant.move(file: '../jsweet', tofile: '../frontend/src/jsweet') }
}
Error:
$ ./gradlew jsweetMove
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':jsweetMove'.
> Cannot convert extension 'jsweet' to a task.
The following types/formats are supported:
- A String or CharSequence task name or path
- A Task instance
- A TaskReference instance
- A Buildable instance
- A TaskDependency instance
- A Provider that represents a task output
- A Provider instance that returns any of these types
- A Closure instance that returns any of these types
- A Callable instance that returns any of these types
- An Iterable, Collection, Map or array instance that contains any of these types
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 641ms
The solution should be referencing a task instead, according to https://stackoverflow.com/questions/38133526/cobertura-task-is-not-getting-included-as-part-of-gradle-build
There is a task indeed: https://github.com/lgrignon/jsweet-gradle-plugin/blob/master/src/main/java/org/jsweet/gradle/JSweetTranspileTask.java#L45
Did you make any progress on this?
Since I am using create-react-app I can't make references from my frontend outside the src folder, thus I wanted to have the generated jsweet files in my frontend src folder. But when I set the targets:
The jsweet build fails:
However, the files seem to be produced and look the same as before. Why is the build failing? Clashing node lib versions? Or why is it suddenly not finding babel etc?