-
Notifications
You must be signed in to change notification settings - Fork 4
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
version.properties write issue when using NetBeans on Windows. #6
Comments
@mitm001 Thanks for the report. Would this work for you?
or mabye:
If it does, I can probably do that internally as you mentioned, but it is not as straight forward as it sounds. Determining what the user's intention are is tricky. For example, if someone uses:
Do they mean the drive's root directory ( I think that it would have to be treated like any other path in Gradle. Right now it works if you try running Gradle from the command line, like the examples show. IDEs call Gradle many different ways, I know it works in Intellij IDEA, never tried it with NetBeans. |
Either would work fine. First one seems more to the point.
I like this myself,
with the period [ ./ ] to dictate current project folder. This is how gradle works. The default use now works for me without having to use semver for some reason but that exposed another problem when using an IDE. I should probably note that in another issue. |
Now that the plugin started working for me when using the Netbeans IDE and defaults, it revealed another problem when there are more than one project using the plugin. The current default behavior will use the IDE root in windows 7 Program Files folder. So that is Program Files\NetBeans\ when writing the version.properties. When you use the plugin again with another project, it uses the same folder so it not only uses the same properties file, it will overwrite it as well. semver will fix that but I still think the plugin should always default to the build.gradle location, or project folder even when using an IDE. Not sure how best to go about that since expected behavior for an IDE is the project folder for all files created. At minimum, docs should make people aware of the situation before they get to far along. |
Should mention, using NetBeans 8. Not sure how any of this would play out in the newer versions. Will be switching to those after 13 is released. |
@mitm001 Version 1.0.1 should fix your problem(s), by using:
The Gradle project directory is now assumed as the default location. Notice that I did not include a Play with it and let me know if that works for you. |
My fix should handle any of it. What I've done is checked to see if the provided properties location is an absolute or relative path; if it is relative, the project directory path is added to make it absolute. |
Getting closer. Now it does write the properties file to the project folder by default or when using semver but the file is empty. The file containing the actual properties is in the NetBeans Program Files directory though so there are now two properties files. Including when setting semver. |
I think I know why that is, let me work on it. |
Perfect. Very nice. Defaults to project folder, semver works great. Now the properties file actually works as a properties file where before it was plain text when opened. Thank you. |
Seems that wasn't due to anything but netbeans where double click opens the file as text rather than a properties file. Using Open command opens it as a properties file. Thanks again. |
When using Netbeans, the program is installed under Program Files but the projects themselves are under the User directory where they have read/write permissions.
Plain vanilla use of the semver-gradle plugin grabs the root directory of the Netbeans install under Program Files for writing and reading the version.properties file.
This means I had to use
to actually write to the project folder itself because the Program Files folder does not have write permissions.
Maybe I need to do something different with this plugin but the standard plugins like "java', "idea" etc. do not require this.
The version.properties file should be by default in the same folder the build.gradle folder is and semver defines should be relative to the project unless the user hard codes the location.
The text was updated successfully, but these errors were encountered: