Skip to content

Commit

Permalink
Upgrade the Gradle wrapper to 8.7, and the Gradle plugin to 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroyuki-sato committed May 8, 2024
1 parent 37c8a63 commit 07eec69
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 203 deletions.
199 changes: 153 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,59 +1,166 @@
plugins {
id "com.jfrog.bintray" version "1.1"
id "com.github.jruby-gradle.base" version "0.1.5"
id "java"
id "maven-publish"
id "signing"
id "org.embulk.embulk-plugins" version "0.7.0"
}
import com.github.jrubygradle.JRubyExec
repositories {
mavenCentral()
jcenter()
}

group = "org.embulk"
version = "0.2.0-SNAPSHOT"
description = "Executes a command and reads a file from its STDOUT."

configurations {
provided
compileClasspath.resolutionStrategy.activateDependencyLocking()
runtimeClasspath.resolutionStrategy.activateDependencyLocking()
}

sourceCompatibility = 1.7
targetCompatibility = 1.7
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
options.encoding = "UTF-8"
}

version = "0.2.0-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}

withJavadocJar()
withSourcesJar()
}

dependencies {
compile "org.embulk:embulk-core:0.8.+"
provided "org.embulk:embulk-core:0.8.+"
testCompile 'org.embulk:embulk-core:0.8.+:tests'
testCompile "junit:junit:4.+"
}

task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file("classpath").deleteDir() }
from (configurations.runtime - configurations.provided + files(jar.archivePath))
into "classpath"
}
clean { delete 'classpath' }

task gem(type: JRubyExec, dependsOn: ["build", "gemspec", "classpath"]) {
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
script "build/gemspec"
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
}

task gemspec << { file("build/gemspec").write($/
Gem::Specification.new do |spec|
spec.name = "${project.name}"
spec.version = "${project.version}"
spec.authors = ["Sadayuki Furuhashi"]
spec.summary = %[Command file input plugin for Embulk]
spec.description = %[Executes a command and reads a file from its STDOUT.]
spec.email = ["[email protected]"]
spec.licenses = ["Apache 2.0"]
spec.homepage = "https://github.com/embulk/embulk-input-command"

spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
spec.test_files = spec.files.grep(%r"^(test|spec)/")
spec.require_paths = ["lib"]

spec.add_development_dependency 'bundler', ['~> 1.0']
spec.add_development_dependency 'rake', ['>= 10.0']
end
/$)
compileOnly "org.embulk:embulk-spi:0.11"
implementation "org.embulk:embulk-util-config:0.5.0"
implementation "org.embulk:embulk-util-file:0.2.0"

testImplementation "junit:junit:4.13.2"
}

embulkPlugin {
mainClass = "org.embulk.input.CommandFileInputPlugin"
category = "input"
type = "command"
}

gem {
authors = [ "Sadayuki Furuhashi" ]
email = [ "[email protected]" ]
// "description" of the gem is copied from "description" of your Gradle project.
summary = "Command file input plugin for Embulk"
homepage = "https://github.com/embulk/embulk-input-command"
licenses = [ "Apache-2.0" ]

from rootProject.file("LICENSE")
}

gemPush {
host = "https://rubygems.org"
}


jar {
metaInf {
from rootProject.file("LICENSE")
}
}

sourcesJar {
metaInf {
from rootProject.file("LICENSE")
}
}

// A safer and strict alternative to: "dependencies" (and "dependencies --write-locks")
//
// This task fails explicitly when the specified dependency is not available.
// In contrast, "dependencies (--write-locks)" does not fail even when a part the dependencies are unavailable.
//
// https://docs.gradle.org/8.7/userguide/dependency_locking.html#generating_and_updating_dependency_locks
task checkDependencies {
notCompatibleWithConfigurationCache("The task \"checkDependencies\" filters configurations at execution time.")
doLast {
configurations.findAll { it.canBeResolved }.each { it.resolve() }
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name

from components.java
// javadocJar and sourcesJar are added by java.withJavadocJar() and java.withSourcesJar() above.
// See: https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/JavaPluginExtension.html

pom { // https://central.sonatype.org/pages/requirements.html
packaging "jar"

name = project.name
description = project.description
url = "https://www.embulk.org/"

licenses {
license {
// http://central.sonatype.org/pages/requirements.html#license-information
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}

developers {
developer {
name = "Sadayuki Furuhashi"
email = "[email protected]"
}
}

scm {
connection = "scm:git:git://github.com/embulk/embulk-input-command.git"
developerConnection = "scm:git:[email protected]:embulk/embulk-input-command.git"
url = "https://github.com/embulk/embulk-input-command"
}
}
}
}

repositories {
maven { // publishMavenPublicationToMavenCentralRepository
name = "mavenCentral"
if (project.version.endsWith("-SNAPSHOT")) {
url "https://oss.sonatype.org/content/repositories/snapshots"
} else {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}

credentials {
username = project.hasProperty("ossrhUsername") ? ossrhUsername : ""
password = project.hasProperty("ossrhPassword") ? ossrhPassword : ""
}
}
}
}

signing {
if (project.hasProperty("signingKey") && project.hasProperty("signingPassword")) {
logger.lifecycle("Signing with an in-memory key.")
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.maven
}

test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
showStandardStreams = true
outputs.upToDateWhen { false }
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Aug 11 00:26:20 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
Loading

0 comments on commit 07eec69

Please sign in to comment.