Skip to content

Commit

Permalink
gathering dependencies for each subproject - tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fishinitself committed May 25, 2024
1 parent 5355920 commit e891d95
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ command-and-arguments=-Poctopus-release-management.version=__RELEASE_MANAGEMENT_
--info \
--stacktrace \
-Dorg.gradle.daemon=false \
exportDependenciesToTeamcity
assemble
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ command-and-arguments=-Poctopus-release-management.version=__RELEASE_MANAGEMENT_
--info \
--stacktrace \
-Dorg.gradle.daemon=false \
exportDependenciesToTeamcity
assemble
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,28 @@ class ReleaseManagementGradlePlugin implements Plugin<Project> {
}
}
}

def exportDependenciesToTeamcitySpecified = project.gradle.startParameter.taskNames.any { it.endsWith("exportDependenciesToTeamcity") }

if (!exportDependenciesToTeamcitySpecified && !rootProject.gradle.startParameter.offline && !project.rootProject.extensions.extraProperties.escrowBuild) {
def releaseManagementDependenciesExtension = project.rootProject.extensions.getByType(ReleaseManagementDependenciesExtension.class)
if (releaseManagementDependenciesExtension.releaseDependenciesConfiguration.isTouched() || rootProject.findProperty("includeAllDependencies")?.toString()?.equalsIgnoreCase("true")) {
if (releaseManagementDependenciesExtension.releaseDependenciesConfiguration.autoRegistration || rootProject.hasProperty("buildVersion")) {
def exportDependenciesToTeamcityTask = rootProject.getTasksByName("exportDependenciesToTeamcity", false)[0] as ExportDependenciesToTeamcityTask
rootProject.gradle.buildFinished { BuildResult buildResult ->
if (buildResult.failure == null) {
exportDependenciesToTeamcityTask.exportDependencies()
} else {
LOGGER.debug("Skip executing the exportDependenciesToTeamcity task because of build failure")
}
}
} else {
LOGGER.debug("The exportDependenciesToTeamcity task autorun is not enabled")
}
} else {
LOGGER.debug("The release management extension is not configured, skip exporting dependencies to TeamCity")
}
}
}

def baseUrl = System.getenv('ARTIFACTORY_URL') ?: project.properties.get('artifactoryUrl')
Expand Down

0 comments on commit e891d95

Please sign in to comment.