Date: Fri, 29 Mar 2024 10:16:01 +0000 (UTC) Message-ID: <907493742.7827.1711707361515@ip-10-10-7-29.ec2.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7826_1638964436.1711707361514" ------=_Part_7826_1638964436.1711707361514 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
A functional gradle build environment exists in the Github repository in= branch "gradle". The build is orchestrated by a parent build.gradle file f= or the root grouper project and a number of individual build.gradle file fo= r every module that Grouper presently houses. Each build.gradle file inheri= ts from the parent build.gradle file and in turn is able to specify its own= requirements for dependency management and source tree structure. The list= of Grouper modules that are recognized by the Gradle build is specified vi= a a settings.gradle in a specific order to account for the build dependenci= es of the modules. There is also one gradle.properties file which hosts spe= cific build settings for the project, such as groupid, java version and dep= endency versions used throughout the project.
To run the full build, issue the following command at the root:
./gradl= ew build -x test -x javadoc --parallel --stacktrace
The same command can be used inside a specific module directory to build= that module only.
Branch Info
You can use "-x" to skip specific tasks during the build lifecycle.
The above command will use the Gradle wrapper to download an appropriate= Gradle version once to be used for the build. This removes the requirement= for a developer to explicitly have Gradle downloaded and installed, but if= a Gradle installation is already available, the same command can be used v= ia invoking the native Gradle instance installed. Build artifacts are = produced for each module inside the build/libs directory. JAR files are pro= duced for main, tests and javadoc.
./gradl= e build -x test -x javadoc --parallel --stacktrace
Windows Gradle Wrapper
Windows version of the wrapper command is also available as gradlew.bat<= /p>
The following gradle commands may also prove useful during development:<= /p>
# Show = all the project dependencies ./gradle dependencies=20 # Show where a specific dependency for a gradle configuration comes from ./gradle dependencyInsight --dependency <name> --configuration <co= mpile/runtime/testCompile/...> # Prepare an Intellij IDEA workspace for Grouper ./gradle idea # Prepare an Eclipse project workspace for Grouper ./gradle eclipse
The Gradle wrapper need only exist at the root of the project. The wrapp= er can be updated to note a specific newer version of a Gradle via the foll= owing command:
./gradl= e wrapper
To produce the Javadoc for the entire project, run the following command= at the root:
./gradl= ew build alljavadoc -x test -x javadoc --parallel --stacktrace
The above command aggregates the javadocs for all grouper modules inside= the root build/javadoc directory.
Grouper is configured against Travis CI to execute the full build on eve= ry commit. Travis builds all grouper branches provided there is a .travis.y= ml inside the branch at the root of the repository. This is a YAML configur= ation file that tells Travis what version of Java should be available, whic= h commands to use for the build lifecycle and which scripts to execute afte= r a successful build.
Branch Info
The configuration file must be massaged for every branch to tell Travis = to limit the build to that branch only, for faster builds.
As part of the Travis CI build, Javadocs are published to the gh-pages o= f the repository, available on the web here, once a successful builds. Th= is is handled via the javadocs-gh= pages.sh script that runs after the build. The script will attempt to c= ollect all project javadocs and push them to the appropriate branch. In ord= er for the push to succeed, an OAUTH token is made available to the script = to do the job. The OAUTH token must be generated by a developer with push r= ights to the repo, and must be encrypted and placed inside the .travis.yml = file under a "secure" heading.
Branch Info
The script file must be massaged for every branch to tell Travis to limi= t the build to that branch only.
OAUTH token can be encrypted for Travis via the follow= ing command:
gem ins= tall travis travis login --github-token <TOKEN> travis encrypt GH_TOKEN=3D<GH-TOKEN>-r Internet2/grouper
As part of the Travis CI build, SNAPSHOT artifacts for all grouper modul= es listed in the settings.gradle file are published to the Sonatype snapshot repositories for Groupe= r once a successful builds. This is handled via the deploy-to-sonatype.sh script that runs after t= he build. The script will attempt will collect all JAR artifacts produced b= y the build and will attempt to publish them. The command that used by the = script is:
./gradl= ew uploadArchives -DpublishSnapshots=3Dtrue -DsonatypeUsername=3D$SONATYPE_= USER -DsonatypePassword=3D$SONATYPE_PWD
The above command invokes the "uploadArchives" task of Gradle to start p= ublishing. The configuration of this task is specified in the root build.gr= adle file.
In order for the command to succeed, a developer must provide his/her ow= n Sonatype credentials, and must also be authorized to publish artifacts to= the edu.internet2.grouper namespace. Credentials that are required for the= command to succeed are encrypted and placed inside the .travis.yml file&nb= sp;under a "secure" heading. The developer must also be authorized to have = access to the "Settings" area of the Grouper github repository.
Branch Info
The script file must be massaged for every branch to tell Travis to limi= t the build to that branch only.
Sonatype credentials can be encrypted for Travis via the following comma= nd:
gem ins= tall travis travis login --github-token <TOKEN> travis encrypt SONATYPE_USER=3DyourUsername -r Internet2/grouper travis encrypt SONATYPE_PWD=3DyourPassword -r Internet2/Grouper
Set java home and path
C:\User= s\mchyzer\Documents\GitHub\grouper\grouper>set JAVA_HOME=3DC:\dev_inst\j= ava7 C:\Users\mchyzer\Documents\GitHub\grouper\grouper>set PATH=3D%JAVA_HOME%= \bin;%PATH%