Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel2

Structure

First decide between type 1 and type 2.

For type 1, the repository is a single project with source sets.

Type 2 is a repository containing 2 or more subprojects. Common properties are contained in product.properties.

Image Removed

Repository as a single project

gradle.properties

extraSourceSets = [] - Extra source sets. Will create multiproject build with seperate dependency tree for each. (ex. ["test", "visualizers"])

publishMode = SNAPSHOT - Publish mode. SNAPSHOT or STABLE
STABLE results in publish version exactly as declared (ex. 0.1.0)
SNAPSHOT creates version of form 0.1.0-SNAPSHOT-5 where 5 is bambooBuildNumber

groupDependencyVersion = SNAPSHOT-LATEST - This variable gets placed as the version of many IHMC dependencies. On Bamboo, this gets overridden to SNAPSHOT-BAMBOO, which snaps the dependencies to specific build numbers and branches. SNAPSHOT-LATEST will pull the latest snapshots from Artifactory. You can pin a version too, like 0.9.1, or 0.10.0-SNAPSHOT-branch-name-1-5.

depthFromWorkspaceDirectory = 1 - Depth from repository group folder. This will always be 1 for type 1 repositories.

excludeFromCompositeBuild = false - Whether to exclude this project from being built from source # when building other projects in your repository group folder.

includeBuildsFromWorkspace = true - When building this project, whether to initiate a composite build on everything in the same repository folder. e.g. Build dependencies from source if they are found on disk. 

Code Block
languagetext
hyphenatedName = your-project-hyphenated
pascalCasedName = YourProjectPascalCased
extraSourceSets = []
publishMode = SNAPSHOT
groupDependencyVersion = SNAPSHOT-LATEST
depthFromWorkspaceDirectory = 1
excludeFromCompositeBuild = false
includeBuildsFromWorkspace = true

settings.gradle

...

languagegroovy

...

Updated instructions at https://github.com/ihmcrobotics

...

build.gradle

Code Block
languagegroovy
buildscript {
   repositories {
      maven { url "https://plugins.gradle.org/m2/" }
      mavenLocal()
   }
   dependencies {
      classpath "gradle.plugin.us.ihmc:ihmc-build:0.10.2"
   }
}
apply plugin: "us.ihmc.ihmc-build"

ihmc {
   group = "us.ihmc"
   version = "0.0.1"
   vcsUrl = "https://github.com/ihmcrobotics/test-project"
   openSource = true
   
   configureDependencyResolution()
   configurePublications()
}
mainDependencies {
   compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
   compile group: 'commons-io', name: 'commons-io', version: '2.4'
   compile group: 'us.ihmc', name: 'ihmc-commons', version: '0.11.2'
}

testDependencies {
   compile group: 'junit', name: 'junit', version: '4.11'
   compile group: 'us.ihmc', name: 'ihmc-continuous-integration-framework', version: '0.9.4'
   compile group: 'org.pitest', name: 'pitest-command-line', version: '1.1.9'
   compile group: 'us.ihmc', name: 'ihmc-commons-testing', version: '0.11.2'
}

Repository as a group of projects

root gradle.properties

Code Block
languagetext
# This variable declares the root of a type 2 repository
isProjectGroup = true

hyphenatedName = repository-product-name
pascalCasedName = RepositoryProductName
extraSourceSets = []
publishMode = SNAPSHOT
groupDependencyVersion = SNAPSHOT-LATEST
depthFromWorkspaceDirectory = 1
excludeFromCompositeBuild = false
includeBuildsFromWorkspace = true
artifactoryUsername = unset_username
artifactoryPassword = unset_password
bintray_user = unset_user
bintray_key = unset_key

root product.properties

Code Block
group = us.ihmc
version = 0.0.1
vcsUrl = https://github.com/your-org/your-repository-group

# Setting this to false disables Apache 2.0 license,
# declares "Proprietary" license in POMs, switches
# stable publish target from Bintray to Artifactory
# proprietary repository, and declares proprietary 
# repository for dependency resolution.
openSource = true

...

Code Block
languagetext
hyphenatedName = your-project-hyphenated
pascalCasedName = YourProjectPascalCased
extraSourceSets = []
publishMode = SNAPSHOT
groupDependencyVersion = SNAPSHOT-LATEST
depthFromWorkspaceDirectory = 2
excludeFromCompositeBuild = false
includeBuildsFromWorkspace = true

...

Code Block
languagegroovy
buildscript {
   repositories {
      maven { url "https://plugins.gradle.org/m2/" }
      mavenLocal()
   }
   dependencies {
      classpath "gradle.plugin.us.ihmc:ihmc-build:0.10.2"
   }
}

import us.ihmc.build.IHMCSettingsConfigurator

def ihmcSettingsConfigurator = new IHMCSettingsConfigurator(settings, logger, ext)
ihmcSettingsConfigurator.configureProjectName(hyphenatedName) // rootProject.name = hyphenatedName
ihmcSettingsConfigurator.configureAsGroupOfProjects() // isProjectGroup = true

if (Boolean.valueOf(includeBuildsFromWorkspace))
{
   ihmcSettingsConfigurator.findAndIncludeCompositeBuilds() // Search workspace and `includeBuild` matches
}

root build.gradle

Code Block
languagegroovy
buildscript {
   repositories {
      maven { url "https://plugins.gradle.org/m2/" }
      mavenLocal()
      jcenter()
   }
   dependencies {
      classpath "gradle.plugin.us.ihmc:ihmc-build:0.10.2"
   }
}
apply plugin: "us.ihmc.ihmc-build"

subproject build.gradle

...

languagegroovy

...

/

...

ihmc

...

-build

...

Groups of Repositories

...