Is there a reason to install Gradle instead of using gradlew? - gradle

The recommended way to use Gradle is through the Gradle Wrapper, (gradlew), which is checked into version control of the project.
My question is: is there any reason to install Gradle myself from http://www.gradle.org/downloads instead of using the wrapper everywhere? (and copying the wrapper to new projects from an older project)

If You work with gradle occasionally (not with one particular project (or a set of projects)) it's very useful to have gradle installed on command line. Then You can easily create a script and check if it works fine. With gradle installed on CL it's very easy and fast (no need to download the whole distribution every time). Beside this one particular use case nothing else comes to my head.
P.S. There's a great tool for gradle (and other tools) version management: GVM.

Related

Unable to find Groovy method when building Rhino with Intellij IDEA

While trying to build https://github.com/mozilla/rhino, I'm getting Unable to find method on org.codehaus.groovy.runtime.StringGroovyMethods.
so the build fails, and I'm unable to test Rhino built from source code, which is the goal.
Steps Taken
From the opening screen in IntelliJ, I check out the project:
I get this error Unable to find method ''java.lang.String org.codehaus.groovy.runtime.StringGroovyMethods.capitalize(java.lang.String)'' right away, which I have not been able to fix:
There are two suggestions in the above Re-download dependencies and sync project and Stop Gradle build processes. I have tried both with no improvement.
When I look at the build.gradle file, I see another suggestion ...configure Gradle wrapper to use distribution with sources.... This also does not get past the missing Groovy method problem.
I have looked on S.O. for similar issues and tried various things under File > Settings > Build, Execution, Deployment, but I realized I'm over my head since, conceptually, I'm not sure what I need and where that would go in the settings.
The command line items from the readme work as expected, but going back to File > Build still fails (added after tim_yates comment).
What changes are required to the IDE or to the build definitions to allow Mozilla Rhino to build properly?
I installed the latest (2022.1) version of IntelliJ IDEA Community Edition. During the install, it asked if you wanted this IDE to be associated with Groovy file types, and I answered in the affirmative.
On this new install, the Unable to find method on org.codehaus.groovy.runtime.StringGroovyMethodserror did not appear, so the problem was solved by upgrading the IDE (and also that required updating GIT).

are there other possible ways to use groovy in Eclipse except plugin

I am using eclipse Mars 4.5.0 IDE and I would like to do some Groovy project.Adding groovy as a plugin is not working, because I am not able to connect to http://dist.springsource.org/snapshot/GRECLIPSE/e4.5/p2.index. In fact even simple update are not working. There is always some connection time out like connection to http://download.eclipse.org/eclipse/update/4.5/content.xml.
However I do have groovy installed on my system. Is there anyway I could tell the IDE to use the system groovy? Or is it possible to download the plugin and manually add it to the IDE? I am using windows 7
The groovy compiler delivered by the plugin is patched and therefore I don't think it is possible to use an external groovy compiler.
If you're behind a proxy, try to configure eclipse with manual proxy settings.
At least the 4.6 and 4.7 snapshot update site works well for me ATM, but when i had access problems, I downloaded the last working build from the ci server mentioned in the wiki:
e.g. E45 build and publish -> #393 -> Artifacts -> Zipped Update Site
and used it as an update site (add.. -> archive).

jenkins enable maven command line

I want to setup jenkins using the command-line only. I am successfully able to install plugins and configure jobs. So i've installed the maven-plugin using jenkins-cli but want to be able to configure it to say "Automatically install maven latest version" so that when the user triggers a build it will automatically go download maven and then use it just like it does using the GUI.
Any advice on how i can do this piece of configuration on the command-line (or scripted ideally) please?
This option is not and should never be available for the reason that it destroys the concept of reproducible builds.
Changing the maven version deliberately may break the build at some future time for no apparent reason and will definitely startle your users then.
Please avoid this situation.
Why not use maven wrapper instead, this way each project configures specifically which version of maven it needs and automatically downloads it.
https://github.com/takari/maven-wrapper
https://github.com/takari/maven-wrapper/blob/master/README.md

Can msbuild install applications on Windows, for example java JDK?

I am working to automate the install of some software.
It relies on some things like the Java JDK and well lots of things that have manual steps installing and copying things around.
I would like to be able to test if the various packages are installed and if not install or update them.
How likely is it that I can get MSBuild to do this sort of work? If unlikely then where can I look?
Thanks
The answer is Yes. MSBuild can execute any command -- as long as that command does not expect user to be in front of the computer. I know you can do silent JDK install, so you can just execute that command in your MSBuild target.
However a more interesting question is: should you do this? I think that performing machine-wide configuration steps as part of the build is bad practice. For certain things, like deployment of your newly built product for CI cycle it is ok, but for the purpose of the build it will be very inflexible.
What I would recommend in case of JDK: since JDK is big and mostly backwards-compatible, in your build script check if correct version of JDK exists on the machine. If it does not, fail the build and print out instruction in the log how to configure machine. For smaller dependencies, see this SO question.

Continuum finding dependencies and building on chain-dependent projects

I am the Configuration manager for an IT firm. Currently we are using anthill build management server for all our build related purposes. We are looking to implement Continuous Integration in our development life cycle.
Currently the building process is done manually. Suppose there are 5 projects A,B,C,D,E and E is the parent project and the dependency chain does like this:
A->B->C->D->E
What we do is we build A first update project.xml of B to the latest version of A, build B so on and so forth untill all dependent projects get built and finally parent project gets built.
What I am thinking is automating the entire process i.e. automatically finding out dependencies and building them first and then updating the version of parent projects and building them again to a newer version.
Would continuum do this for me? If not is here any other CI tool that does this?
Hudson does this really well, if you're using Maven, it'll even automatically figure out the build dependencies for you automatically after the first build, otherwise you can manually define the build dependencies. I.e., it lets you configure the system to build project B after a successful project A build.
I'm not sure if it matters to you, but Hudson is also open source.
If not is here any other CI tool that does this?
I like TeamCity, which does pretty much everything you'll need. With the latest version (and a plugin from JetBrains), there's even Git support.
On the other hand, any continuous integration system should handle dependencies easily.
We use Zed Builds and Bugs for a setup similar to this. We have a master project that has sub-project dependencies and the build system handles everything in the proper order.
We also have very small, tight builds for the sub-projects so that each of them can be built when the developers commit to source control. The Zed Server is capable of pulling the latest artifacts from these small builds and putting them together into larger builds, but we haven't yet used that feature.
Our check-ins trigger the small CI builds, and then twice per day the entire application is re-built from scratch, following the dependency chain.
I'd agree with OregonGhost, though, any CI system should be able to set up this type of chain.
I don't think you need a CI tool for this. Try to automate this using a buildscript and use Continuum (or any other CI tool) to trigger your preferred buildtool.

Resources