-
Notifications
You must be signed in to change notification settings - Fork 35
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
Plugin fails to run. #16
Comments
I don't have access to a windows 7 machine right now, but I'll increase the priority of issue #10 on my TODO list (I couldn't reproduce the problem on Linux, OpenJDK 7, Gradle 3.4) |
I re-tried on windows 7, but couldn't reproduce the problem: C:\Users\admin\Desktop>java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
C:\Users\admin\Desktop>gradle -version
------------------------------------------------------------
Gradle 3.4
------------------------------------------------------------
Build time: 2017-02-20 14:49:26 UTC
Revision: 73f32d68824582945f5ac1810600e8d87794c3d4
Groovy: 2.4.7
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.7.0_80 (Oracle Corporation 24.80-b11)
OS: Windows 7 6.1 amd64
C:\Users\admin\Desktop>gradle goJF
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --statu
s for details
:googleJavaFormat NO-SOURCE
BUILD SUCCESSFUL
Total time: 6.241 secs
C:\Users\admin\Desktop> I also tried with Java 8 and didn't have any problems. PS: I don't understand why I have to create an Oracle account in order to download Java 7... ugh! |
I can't reproduce this problem today. I have tried two projects (one of which failed last week) and it works fine. |
I had the same failure with google-java-format-gradle-plugin version 0.6 on Win10 with jdk8. The "String index out of range" at GoogleJavaFormatExtension.groovy:32 could occur if your projects don't share the same parent directory. This can happen, for example, if you are using dependency substitution in your Gradle project, and replacing some of your modules with projects that reside in a parent directory outside your current project. For me the workaround was to avoid using dependency substitution in my build.gradle while running this plugin's tasks. |
The expression at GoogleJavaFormatExtension.groovy:32 "p.buildDir.path.substring(project.projectDir.path ..." may produce unexpected results if one project is not nested within another. This could happen, for example, due to Gradle dependency substitution, if you replace a module with a project in a parent directory. |
@mcs6502 Thanks for the detailed analysis (and sorry for the delay). I've never used dependency substitution before. Do you have an example project at hand? |
Same issue here - I get the same String index out of range error when defining a Gradle dependency in a separate folder. This didn't work:
The fix was to comment out the projectDir which isn't great because now it won't build so I have to comment, verify, uncomment, build.
|
I'm experiencing this issue today on macOS. |
I can't get your plugin to work
Gradle version 3.4
Java 7 64bit
Windows 7 64Bit
Build.gradle
This is the gradle error:
Exception stacktrace:
The text was updated successfully, but these errors were encountered: