Closed Skillzore closed 3 years ago
You just need to add the proper repositories, please see the README: https://github.com/lgrignon/jsweet-gradle-plugin
That being said, main artifacts should be made available in public repos, I will sync it when I find time.
As a side note, I have to say that I don't recommend using JSweet to transpile a react app. React JSweet's candy is very complicated. However, if your goal is just to transpile some Java code to make it available to your TS app, well, that's exactly what JSweet is good at. Just use the gradle plugin to transpile the Java source located in the input folder and you will be good to go.
Can I ask why did you specify "only transpiler"? Because it really seems like you want to use the gradle plugin :)
Ah, sorry if I am confusing. I simply don't know how it works. Yes, it does seem like I want to use the plugin to run the jsweet transpiler on some of my java code and get some typescript back to hook into to my react client. I do not intend on transpiling an entire app, no worries there.
I was trying to be as minimal as possible to not include any unnecessary jsweet parts. I have read the readme, I guess what I am wondering is if I need all the repos? What is the minimal setup I would need to run jsweet-transpiler on my java code?
The README is the recommended setup :)
You can also take a look at this build.gradle example: https://github.com/cincheo/jsweet-examples/
Alright, I'll try it out then. Thanks!
Hi again!
Following the readme, I now have this build file:
buildscript {
repositories {
mavenCentral()
maven { url "http://repository.jsweet.org/artifactory/libs-release-local" }
maven { url "http://repository.jsweet.org/artifactory/libs-snapshot-local" }
maven { url "http://repository.jsweet.org/artifactory/plugins-release-local" }
maven { url "http://repository.jsweet.org/artifactory/plugins-snapshot-local" }
maven { url "http://google-diff-match-patch.googlecode.com/svn/trunk/maven" }
}
dependencies {
classpath('org.jsweet:jsweet-gradle-plugin:3.0.0') { //
transitive = true }
}
}
dependencies {
compile group: 'org.jsweet', name: 'jsweet-transpiler', version: "3.0.0"
compile group: 'org.jsweet', name: 'jsweet-core', version: "6"
compile group: 'org.jsweet.candies', name: 'angular', version: "1.4.0-20170726"
compile group: 'org.jsweet.candies', name: 'angular-route', version: "1.2.0-20170726"
}
compileJava {
enabled = false
}
apply plugin: 'org.jsweet.jsweet-gradle-plugin'
jsweet {
verbose = true
encoding = 'UTF-8'
sourceMap = true
tsout = project.file('target/typescript')
outDir = project.file('target/javascript')
candiesJsOut = project.file('target/candies')
targetVersion = 'ES6'
includes = ['**/src/main/poc/validation.java']
// extraSystemPath = '/my/path/to/npm'
}
Running ./gradlew tasks
i get the following error:
Adding the --stacktrace
flag reveals an argument exception.
The gradle build file and gradlew that I have are from a spring boot setup. Could it be that the plugin doesn't play well with spring boot gradle?
I think latest Gradle is unfortunately not supported, please see https://github.com/lgrignon/jsweet-gradle-plugin/issues/24
Please open a new issue if you notice new problems
Ah, sorry. Googled my error, weird I didn't get a hit on the stack trace in the issue you linked. I'll change my Gradle version and see if it helps.
Published: jsweet-transpiler jsweet-core j4ts jsweet-maven-plugin jsweet-gradle-plugin
on bintray & maven central
Hi!
I am trying to add the jsweet-transpiler and only the transpiler to an existing react project that I have. I am hoping to use the transpiler to create typescript code from my java validation code and run that typescript code on the clientside.
What I have added to my build.gradle so far:
I didn't really expect this to work, since I can't find instructions to include only the transpiler using gradle. I get the following error:
Is it possible to integrate just the jsweet transpiler into my project using this gradle plugin?