facewindu / gradle-build-scan-teamcity-plugin

Gradle plugin for build scans that notifies TeamCity when a build scan is published during a build.

Home Page:https://gradle.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gradle-build-scan-teamcity-plugin

The work on this software project is in no way associated with my employer nor with the role I'm having at my employer. Any requests for changes will be decided upon exclusively by myself based on my personal preferences. I maintain this project as much or as little as my spare time permits.

Overview

Gradle plugin that notifies TeamCity when a build scan is published during a build. The plugin works in collaboration with the Build scan TeamCity integration.

Build scans are available as a free service on scans.gradle.com and commercially via Gradle Enterprise.

The plugin is hosted at Bintray's JCenter.

Build scan

Recent build scan: https://scans.gradle.com/s/j56egl3btxzsq

Find out more about build scans for Gradle and Maven at https://scans.gradle.com.

Goals

When not using TeamCity's GradleRunner to launch Gradle builds, this plugin can be used to notify TeamCity about the build scans that were published while running a build. If you use the GradleRunner to launch Gradle builds, there is no need to apply the plugin to your builds.

Functionality

The plugin sends a service message that contains the published build scan URLs to TeamCity via Gradle's logging infrastructure. The service message is only interpreted by TeamCity if the Build scan TeamCity integration is enabled on the TeamCity server.

Design

The service message sent via Gradle's logging infrastructure follows the message pattern expected by TeamCity which is ##teamcity[message-name 'arguments'].

Configuration

Applying the plugin

Project-application

For Gradle versions < 6.0, apply the nu.studer.build-scan.teamcity plugin (and the com.gradle.build-scan plugin) to your Gradle project.

plugins {
  id 'nu.studer.build-scan.teamcity' version '1.1'
  id 'com.gradle.build-scan' version '3.1.1'
}

Please refer to the Gradle DSL PluginDependenciesSpec to understand the behavior and limitations when using the new syntax to declare plugin dependencies.

Settings-application

For Gradle versions >= 6.0, apply the nu.studer.build-scan.teamcity plugin (and the com.gradle.enterprise plugin) to your Gradle settings file.

buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath 'nu.studer:gradle-build-scan-teamcity-plugin:1.1'
    }
}

plugins {
  id 'com.gradle.enterprise' version '3.1.1'
}

apply plugin: 'nu.studer.build-scan.teamcity'

Feedback and Contributions

Both feedback and contributions are very welcome.

Acknowledgements

  • facewindu (pr for Gradle Enterprise plugin integration)
  • guylabs (pr for Gradle Enterprise plugin integration)
  • mark-vieira (pr that provides message service functionality)

License

This plugin is available under the Apache License, Version 2.0.

(c) by Etienne Studer

About

Gradle plugin for build scans that notifies TeamCity when a build scan is published during a build.

https://gradle.com

License:Apache License 2.0


Languages

Language:Groovy 60.3%Language:Java 39.7%