typelead/intellij-eta

How to build on a Windows machine?

Opened this issue · 6 comments

I tried to run "gradlew :plugin:assemble", it downloads all dependencies and all that stuff but after a while the command prompt just shows the following and nothing happens:

D:\projects\intellij-eta>gradlew :plugin:assemble
Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details
<=============> 100% CONFIGURING [1m 17s]
> IDLE

I don't know what to do anymore... I would really appreciate any help!

When I run the command with debug logging, the last lines before it hangs infinitely are:

[...]
16:59:22.610 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Configure project :plugin'
16:59:22.610 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Configure project :plugin' completed
16:59:22.610 [INFO] [org.gradle.internal.buildevents.BuildLogger] All projects evaluated.
16:59:22.670 [INFO] [com.typelead.gradle.utils.DefaultLog] Executing external command: [C:\Users\dev\.gradle\caches\etlas\1.3.0.0\etlas.exe, --disable-send-metrics, select, --list, --installed] in workingDir: null
16:59:24.747 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 6441259008, Free: 2287284224}
[...]

Hi, i am giving a try in my windows machine and i've got to going a step forward with some changes in the build config: see https://github.com/typelead/intellij-eta/compare/master...jneira:windows?expand=1

However i've got another error involving jflex cause the subtasks related are based in nix shell scripts that should be ported to win cmd/ps: https://github.com/typelead/intellij-eta/blob/master/tools/run-jflex

This might be sufficient enough for running JFlex on Windows. I just inlined the parameters, so ideally this should "just work".

java -jar jflex-1.7.0-SNAPSHOT.jar --skel idea-flex.skeleton --nobak plugin/src/main/java/com/typelead/intellij/plugin/eta/lang/lexer/_EtaSyntaxHighlightingLexer.flex

That script is overly complicated and mostly there as copy-pasta from HaskForce where I need to generate five different lexers.

@carymrobbins thanks! with that version of script the build is going forward

You might be able to use this directly in the build.gradle and remove the run-jflex script altogether.

task runJFlex(type: JavaExec) {
  main = '-jar'
  args = [
    'jflex-1.7.0-SNAPSHOT.jar',
    '--skel',
    'idea-flex.skeleton',
    '--nobak',
    'plugin/src/main/java/com/typelead/intellij/plugin/eta/lang/lexer/_EtaSyntaxHighlightingLexer.flex'
  ]
}

It's completely untested and relies on a hack to easily run jar files from Gradle.

If this works, you'd probably also want to only run it if the generated Java file gets out of date (which is exactly what the script is doing at the if [ "$java_file" -nt "$flex_file" ] part).

Hi all, thank you very much for your helpful answer! After moving the project directory to my C: drive (see typelead/eta#856), the build now fails at the following point:

C:\intellij-eta>gradlew -i :plugin:assemble
[...]
Starting Build
Settings evaluated using settings file 'C:\intellij-eta\settings.gradle'.
Projects loaded. Root project using build file 'C:\intellij-eta\build.gradle'.
Included projects: [root project 'intellij-eta', project ':eta-parser', project ':jps-plugin', project ':jps-shared', project ':plugin']

> Configure project :
[...]

> Configure project :eta-parser
[...]

> Configure project :jps-plugin
[...]

> Configure project :jps-shared
[...]

> Configure project :plugin
Evaluating project ':plugin' using build file 'C:\intellij-eta\plugin\build.gradle'.
Configuring IntelliJ IDEA dependency
Using IDE from remote repository
IntelliJ IDEA dependency cache directory: C:\Users\dev\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2018.1.5\e1e20861201ac09734f77b9174e7c2465a611172\ideaIC-2018.1.5
Adding IntelliJ IDEA sources repository
Configuring IntelliJ IDEA extra dependencies []
IntelliJ IDEA IC-181.5281.24 is used for building
Configuring IntelliJ IDEA plugin dependencies
Configuring IntelliJ plugin properties
Looking for builtin properties in C:\Users\dev\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2018.1.5\e1e20861201ac09734f77b9174e7c2465a611172\ideaIC-2018.1.5
Configuring IntelliJ plugin Groovy
Looking for builtin Groovy in C:\Users\dev\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2018.1.5\e1e20861201ac09734f77b9174e7c2465a611172\ideaIC-2018.1.5
Configuring IntelliJ plugin gradle
Looking for builtin gradle in C:\Users\dev\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2018.1.5\e1e20861201ac09734f77b9174e7c2465a611172\ideaIC-2018.1.5
Configuring IntelliJ tests tasks
All projects evaluated.
Executing external command: [C:\Users\dev\.gradle\caches\etlas\1.5.0.0\etlas.exe, --disable-send-metrics, select, --list, --installed] in workingDir: null
Executing external command: [C:\Users\dev\.gradle\caches\etlas\1.5.0.0\etlas.exe, --disable-send-metrics, --select-eta=0.8.0b2, deps] in workingDir: C:\intellij-eta\build\eta-freeze
etlas.exe: No targets given and there is no package in the current directory.
Use the target 'all' for all packages in the project or specify packages or
components by name or location. See 'etlas build --help' for more details on
target options.

FAILURE: Build failed with an exception.

* What went wrong:
Nonzero (1) exit code for command [C:\Users\dev\.gradle\caches\etlas\1.5.0.0\etlas.exe, --disable-send-metrics, --select-eta=0.8.0b2, deps] with workingDir C:\intellij-eta\build\eta-freeze
Process Standard Error:
etlas.exe: No targets given and there is no package in the current directory.
Use the target 'all' for all packages in the project or specify packages or
components by name or location. See 'etlas build --help' for more details on
target options.


* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Once more I am stuck with my knowledge and experience... I would be grateful for any help!