Skip to content

Commit

Permalink
stop using JCenter for publishing (#469)
Browse files Browse the repository at this point in the history
Main goal of this change is to phase out the use of
JCenter before it is [sunset].

[sunset]: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

The following updates have been made:

- Move from TravisCI to Github Actions.
- Update to latest Nebula plugins.
- Update to latest Gradle and codequality plugins.
- Fix a few issues flagged by updated codequality plugins.
- Remove API compatibility check. This broke for some
  and given the current state of Servo, it was just
  removed rather than trying to fix.
  • Loading branch information
brharrington committed Mar 3, 2021
1 parent 7810bb7 commit e29abcf
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 130 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/pr.yml
@@ -0,0 +1,38 @@
name: PR Build

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 15]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- uses: actions/cache@v2
id: gradle-cache
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- uses: actions/cache@v2
id: gradle-wrapper-cache
with:
path: |
~/.gradle/wrapper
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
- name: Build
run: ./gradlew build
validation:
name: "Gradle Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/cache@v2
id: gradle-cache
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- uses: actions/cache@v2
id: gradle-wrapper-cache
with:
path: |
~/.gradle/wrapper
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
- name: Build candidate
if: contains(github.ref, '-rc.')
run: ./gradlew --info --stacktrace -Prelease.useLastTag=true candidate
env:
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
- name: Build release
if: (!contains(github.ref, '-rc.'))
run: ./gradlew --info -Prelease.useLastTag=true final
env:
NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }}
NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }}
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
37 changes: 37 additions & 0 deletions .github/workflows/snapshot.yml
@@ -0,0 +1,37 @@
name: Snapshot

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/cache@v2
id: gradle-cache
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- uses: actions/cache@v2
id: gradle-wrapper-cache
with:
path: |
~/.gradle/wrapper
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
- name: Build
run: ./gradlew build snapshot
env:
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

31 changes: 17 additions & 14 deletions build.gradle
Expand Up @@ -16,17 +16,17 @@

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.netflix.nebula:nebula-dependency-recommender:6.1.1'
classpath 'com.netflix.nebula:nebula-dependency-recommender:9.1.1'
classpath 'com.netflix.nebula:gradle-netflixoss-project-plugin:9.1.0'
}
}

plugins {
id 'nebula.netflixoss' version '7.1.0'
id 'me.champeau.gradle.jmh' version '0.4.7'
id "com.github.spotbugs" version "1.6.9" apply false
id 'me.champeau.gradle.jmh' version '0.5.2'
id "com.github.spotbugs" version "4.6.0" apply false
}

ext {
Expand All @@ -35,20 +35,20 @@ ext {

allprojects {
apply plugin: 'nebula.dependency-recommender'
apply plugin: 'nebula.netflixoss'
apply plugin: 'me.champeau.gradle.jmh'
}

subprojects {
apply plugin: 'nebula.netflixoss'
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'java-library'
apply plugin: 'com.github.spotbugs'
apply plugin: 'checkstyle'
apply plugin: 'pmd'

group = "com.netflix.${githubProjectName}"

repositories {
jcenter()
mavenCentral()
}

sourceCompatibility = '1.8'
Expand Down Expand Up @@ -93,26 +93,29 @@ subprojects {
}

checkstyle {
toolVersion = '8.39'
ignoreFailures = false
toolVersion = '8.14'
configFile = rootProject.file('codequality/checkstyle.xml')
sourceSets = [sourceSets.main]
}

spotbugs {
toolVersion = '3.1.10'
toolVersion = '4.2.0'
excludeFilter = rootProject.file('codequality/findbugs-exclude.xml')
ignoreFailures = false
sourceSets = [sourceSets.main]
spotbugsMain.enabled = true
spotbugsTest.enabled = false
spotbugsJmh.enabled = false
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
spotbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}

pmd {
toolVersion = '6.9.0'
toolVersion = '6.30.0'
ignoreFailures = false
ruleSets = []
ruleSetFiles = rootProject.files("codequality/pmd.xml")
Expand Down
23 changes: 0 additions & 23 deletions buildViaTravis.sh

This file was deleted.

31 changes: 15 additions & 16 deletions codequality/checkstyle.xml
Expand Up @@ -25,6 +25,16 @@
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!-- what is a good max value? -->
<property name="max" value="120"/>
<!-- ignore lines like "$File: //depot/... $" -->
<property name="ignorePattern" value="\$File.*\$"/>
<property name="severity" value="info"/>
</module>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter"/>
Expand All @@ -43,25 +53,23 @@

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!--
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="scope" value="package"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="scope" value="package"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<module name="JavadocVariable">
<property name="scope" value="public"/>
<property name="scope" value="package"/>
</module>
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true"/>
</module>
-->

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
Expand All @@ -82,16 +90,7 @@
<module name="RedundantImport"/>
<module name="UnusedImports"/>


<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!-- what is a good max value? -->
<property name="max" value="100"/>
<!-- ignore lines like "$File: //depot/... $" -->
<property name="ignorePattern" value="\$File.*\$"/>
<property name="severity" value="info"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>

Expand Down
69 changes: 69 additions & 0 deletions codequality/findbugs-exclude.xml
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<And>
<Class name="com.netflix.spectator.impl.Scheduler$DelayedTask"/>
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.sandbox.HttpResponse"/>
<Bug pattern="EI_EXPOSE_REP"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.sandbox.HttpResponse"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.sandbox.HttpRequestBuilder"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.ipc.http.HttpResponse"/>
<Bug pattern="EI_EXPOSE_REP"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.ipc.http.HttpResponse"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.ipc.http.HttpRequestBuilder"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.api.patterns.LongTaskTimer"/>
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.impl.AsciiSet"/>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.impl.matcher.Parser"/>
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
</And>
</Match>
<Match>
<And>
<Class name="com.netflix.spectator.api.Clock"/>
<Bug pattern="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION"/>
</And>
</Match>
</FindBugsFilter>
Binary file removed codequality/japi-checker-cli-0.2.1-SNAPSHOT.jar
Binary file not shown.
Binary file removed codequality/servo-core-BASELINE.jar
Binary file not shown.

0 comments on commit e29abcf

Please sign in to comment.