What is printed in the output window is just printed for informational purposes. The main difference is that the plugin never really literally issues a Gradle command. There is no reason to compare it to Ant or Maven. It is not that it makes sense or not, it is just not possible. I have serious doubt, that you will find any at least half decent library which will force you to use the working directory. Not using the current working directory is the right thing to do (tm) anyway. You don't have to rely on the command line, you just have to fix the build script. Well, there is a lot of mechnics, just none of them involves the use the working directory. They work as advertised, as far as I know.Īlso, you have said: "at the end of the day, is for mechanics that get the job done". I don't understand your problem with Gradle's API. Also, it is not even obvious which project directory (assuming a multi-project build) are we talking about. For example, it will not be possible to run your script concurrently with another one within a single process. There are quite a few thing which can go wrong, if you just keep carelessly relying on the working directory. Though, even if they changed this behaviour, I would still highly recommend you not to rely on that. If you really-really want to, you can ask Gradleware to change GradleConnector to set the working directory to the project directory (or allow it to be configured). It is illogical for a build script to have two different instances of the " current working directory".ĭespite what you believe, it is not possible for the plugin to set the working directory for your build. The need, at the end of the day, is for mechanics that get the job done. I saw for example the same question asked on Stackoverflow how to set the right directory for an Ant plugin. Looking over the Gradle v3.4.1 documents today, every mention of folders, files and projects documents them as " relative to the project directory"įurthermore the section on " Working with Files" repeats this information:Īnd while " Yes." Gradle has methods to ensure a file is loaded in context not no Java, Ant, Groovy and not every Gradle snippet is/will be written to run in that context. I believe there is a mismatch in current performance and Gradle documentation, see below. As I said for 326 I do not agree with the response. I have pointed #326 here for further comments as this appears to be the core issue. These are different folders and yet ostensibly they are the SAME project - Just different versions. One or two different older versions for bug fixes, current development trunk and perhaps two or more feature branches. Under some scenarios I may have 3 or 4 versions of a project check-out for work. When I begin a Gradle build from the command line that is the only time you know where the project is. Is there an Environment variable that Netbeans sets to provid that location? The project path is meta-data outside the Gradle ken.Īlternatively, is there some Gradle property on the project file that gives the file path to that file at Gradle run-time?įactually the only entity that know where a grade adle file is in the first instance is the application that kicks it off. Netbeans is in Java - yet all the three working build tools manage to run project builds form the project directory.Ĭoncerning the hack of setting the -Duser.dir=my-working-directory - How do you do that!? Only Netbeans has the context of where the build file is loaded from. A great many projects and all the Netbeans generated Ant projects all use relative directory paths relative to the project directory. Īt thie time Gradle plugin is the ONLY project builder that doesn't start the build in the project directory. Netbeans supports 4 build systems that I know about. Specifically the project directory is the place where the parent adle file lives. In the simplest case Netbeans can exec( "gradle build" ) as a command in the project's directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |