Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
use invent gradle plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kashike committed Jun 20, 2019
1 parent 6afee43 commit 5fd7665
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [ ${TRAVIS_PULL_REQUEST} = 'false' ] && [ ${TRAVIS_BRANCH} = 'master' ]; then
./gradlew -PsonatypeUsername="${SONATYPE_USERNAME}" -PsonatypePassword="${SONATYPE_PASSWORD}" build uploadArchives
./gradlew -Psonatype.username="${SONATYPE_USERNAME}" -Psonatype.password="${SONATYPE_PASSWORD}" build publish
else
./gradlew build
fi
117 changes: 45 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
plugins {
id 'java-library'
id 'maven'
id 'maven-publish'
id 'signing'
id 'net.kyori.invent' version '1.0.4'
id 'net.kyori.invent-javadoc-jar' version '1.0.4'
id 'net.kyori.invent-sonatype-repository' version '1.0.4'
id 'net.kyori.invent-sources-jar' version '1.0.4'
id 'net.minecrell.licenser' version '0.4.1'
}

group 'net.kyori'
description 'Filters.'
version '1.0.0-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:all', '-Xlint:-path', '-parameters']
options.deprecation = true
options.encoding = 'UTF-8'
}

test {
useJUnitPlatform()
options.compilerArgs += ['-Xlint:all']
}

license {
Expand All @@ -38,32 +34,12 @@ repositories {
dependencies {
api 'net.kyori:component:1.0.0-SNAPSHOT'
api 'net.kyori:mu:1.0.0-SNAPSHOT'
api 'org.checkerframework:checker-qual:2.7.0'
testImplementation 'com.google.guava:guava-testlib:27.0.1-jre'
testImplementation 'com.google.truth:truth:0.43'
testImplementation 'com.google.truth.extensions:truth-java8-extension:0.43'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
}

task javadocJar(type: Jar) {
classifier 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar
archives sourcesJar
}

signing {
required { !project.version.endsWith('-SNAPSHOT') && gradle.taskGraph.hasTask(':uploadArchives') && project.hasProperty('signing.keyId') }
sign configurations.archives
api 'org.checkerframework:checker-qual:2.8.2'
testImplementation 'com.google.guava:guava-testlib:28.0-jre'
testImplementation 'com.google.truth:truth:0.45'
testImplementation 'com.google.truth.extensions:truth-java8-extension:0.45'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
}

jar {
Expand All @@ -72,52 +48,49 @@ jar {
)
}

if(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
uploadArchives {
enabled = System.getenv('TRAVIS') == null || project.version.endsWith('-SNAPSHOT')
inventSonatypeRepository.enabled = System.getenv('TRAVIS') == null || project.version.endsWith('-SNAPSHOT')

repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
publishing {
publications {
maven(MavenPublication) {
from components.java

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
artifact javadocJar
artifact sourcesJar

pom.project {
description 'filter'
name project.name
url 'https://github.com/KyoriPowered/filter/'
pom {
name = project.name
description = project.description

developers {
developer {
name 'kashike'
}
developers {
developer {
id = 'kashike'
}
}

issueManagement {
system 'GitHub Issues'
url 'https://github.com/KyoriPowered/filter/issues'
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/KyoriPowered/filter/issues'
}

licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
}
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}

scm {
connection 'scm:git@github.com:KyoriPowered/filter.git'
developerConnection 'scm:git@github.com:KyoriPowered/filter.git'
url 'https://github.com/KyoriPowered/filter/'
}
scm {
connection = 'scm:git@github.com:KyoriPowered/filter.git'
developerConnection = 'scm:git@github.com:KyoriPowered/filter.git'
url = 'https://github.com/KyoriPowered/filter/'
}
}
}
}
}

signing {
required { project.hasProperty('signing.keyId') && gradle.taskGraph.hasTask(':publish') && project.version.endsWith('-SNAPSHOT') }
sign publishing.publications.maven
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = 'filter'

4 changes: 2 additions & 2 deletions src/main/java/net/kyori/filter/MultiFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
package net.kyori.filter;

import net.kyori.component.Component;
import net.kyori.mu.examine.Examinable;
import net.kyori.mu.examine.ExaminableProperty;
import net.kyori.mu.examination.Examinable;
import net.kyori.mu.examination.ExaminableProperty;
import net.kyori.mu.stream.MuStreams;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/kyori/filter/SingleFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
package net.kyori.filter;

import net.kyori.component.Component;
import net.kyori.mu.examine.Examinable;
import net.kyori.mu.examine.ExaminableProperty;
import net.kyori.mu.examination.Examinable;
import net.kyori.mu.examination.ExaminableProperty;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/kyori/filter/StaticFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/
package net.kyori.filter;

import net.kyori.mu.examine.Examinable;
import net.kyori.mu.examine.ExaminableProperty;
import net.kyori.mu.examination.Examinable;
import net.kyori.mu.examination.ExaminableProperty;
import org.checkerframework.checker.nullness.qual.NonNull;

import java.util.Objects;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/net/kyori/filter/data/TestFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import net.kyori.filter.FilterQuery;
import net.kyori.filter.TypedFilter;
import net.kyori.mu.examine.Examinable;
import net.kyori.mu.examine.ExaminableProperty;
import net.kyori.mu.examination.Examinable;
import net.kyori.mu.examination.ExaminableProperty;
import org.checkerframework.checker.nullness.qual.NonNull;

import java.util.stream.Stream;
Expand Down

0 comments on commit 5fd7665

Please sign in to comment.