Skip to content

Commit

Permalink
com.palantir.baseline-circleci transitively applies configuration-res…
Browse files Browse the repository at this point in the history
…olver plugin (#309)
iamdanfox authored Jul 31, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4b8879b commit 667854d
Showing 4 changed files with 17 additions and 4 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -278,10 +278,15 @@ configurations.all {

### CircleCi Plugin (com.palantir.baseline-circleci)

Applies [`com.palantir.circle.style`](https://github.com/palantir/gradle-circle-style) plugin which configures junit xml test output to be written to $CIRCLE_TEST_REPORTS directory.
Additionally enables html reports for tests and stores the output in $CIRCLE_ARTIFACTS and if gradle is run with `--profile`
the profiling output is also persisted in $CIRCLE_ARTIFACTS.
Automatically applies the following plugins:

- [`com.palantir.circle.style`](https://github.com/palantir/gradle-circle-style) - this configures checkstyle xml output to be written to the `$CIRCLE_TEST_REPORTS` directory.
- [`com.palantir.configuration-resolver`](https://github.com/palantir/gradle-configuration-resolver-plugin) - this adds a `./gradlew resolveConfigurations` task which is useful for caching on CI.

Also, the plugin:

1. stores the HTML output of tests in `$CIRCLE_ARTIFACTS/junit`
1. stores the HTML reports from `--profile` into `$CIRCLE_ARTIFACTS/reports`

### Copyright Checks

1 change: 1 addition & 0 deletions gradle-baseline-java/build.gradle
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ dependencies {
compile gradleApi()
compile 'com.google.guava:guava'
compile 'gradle.plugin.com.palantir:gradle-circle-style'
compile 'com.palantir.configurationresolver:gradle-configuration-resolver-plugin'
compile 'net.ltgt.gradle:gradle-errorprone-plugin'

testCompile gradleTestKit()
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

package com.palantir.baseline.plugins;

import com.palantir.configurationresolver.ConfigurationResolverPlugin;
import com.palantir.gradle.circlestyle.CircleStylePlugin;
import java.io.File;
import java.io.IOException;
@@ -28,12 +29,13 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.tasks.testing.Test;
import org.gradle.profile.ProfileListener;
import org.gradle.profile.ProfileReportRenderer;

public final class BaselineCircleCi extends AbstractBaselinePlugin {
public final class BaselineCircleCi implements Plugin<Project> {
private static final SimpleDateFormat FILE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
private static final FileAttribute<Set<PosixFilePermission>> PERMS_ATTRIBUTE =
PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxr-xr-x"));
@@ -52,6 +54,10 @@ public void apply(Project project) {
throw new RuntimeException("failed to create CIRCLE_ARTIFACTS directory", e);
}

// the `./gradlew resolveConfigurations` task is used on CI to download all jars for convenient caching
project.getRootProject().allprojects(proj ->
proj.getPluginManager().apply(ConfigurationResolverPlugin.class));

project.getRootProject().allprojects(proj ->
proj.getTasks().withType(Test.class, test -> {
Path junitReportsDir = Paths.get(circleArtifactsDir, "junit");
1 change: 1 addition & 0 deletions versions.props
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ com.google.errorprone:error_prone_core = 2.0.19
com.google.errorprone:error_prone_test_helpers = 2.0.19
com.google.guava:guava = 21.0
com.palantir.baseline:* = 0.24.0
com.palantir.configurationresolver:gradle-configuration-resolver-plugin = 0.3.0
com.palantir.safe-logging:* = 1.4.0
org.slf4j:slf4j-api = 1.7.24
gradle.plugin.com.palantir:gradle-circle-style = 1.1.4

0 comments on commit 667854d

Please sign in to comment.