Skip to content

Commit 97b5aa6

Browse files
committed
Maintain this standard plugin in the standalone repository
1 parent 46862a3 commit 97b5aa6

File tree

197 files changed

+179
-12644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+179
-12644
lines changed

.github/workflows/check.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
matrix:
1212
os:
1313
- ubuntu-latest
14-
# - macOS-latest # https://github.com/embulk/embulk-standards/issues/16
14+
- macOS-latest
1515
- windows-latest
1616
steps:
1717
- name: Set Git's core.autocrlf to false for Windows before checkout
1818
run: git config --global core.autocrlf false
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
- name: Set up OpenJDK 8
21-
uses: actions/setup-java@v2
21+
uses: actions/setup-java@v3
2222
with:
2323
java-version: 8
2424
distribution: "temurin"
@@ -37,5 +37,5 @@ jobs:
3737
- name: Override TEMP to use Windows' long filename (LFN)
3838
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
3939
if: matrix.os == 'windows-latest'
40-
- name: Check all plugins
40+
- name: Check
4141
run: ./gradlew --stacktrace check

README.md

+31-23
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
1-
# embulk-standards: Embulk's standard plugins
1+
# embulk-input-config
22

3-
These are Embulk's "standard" plugins which are embedded in Embulk's executable binary distributions.
3+
This is one of Embulk's "standard" plugins that are embedded in Embulk's executable binary distributions.
44

5-
Their source code had been managed in the same [main repository of Embulk](https://github.com/embulk/embulk) until [`v0.10.33`](https://github.com/embulk/embulk/tree/v0.10.33). They have been split from the main repository since `v0.10.34`.
5+
The source code had been managed in the same [main repository of Embulk](https://github.com/embulk/embulk) until [`v0.10.33`](https://github.com/embulk/embulk/tree/v0.10.33), and in the [`embulk-standards` repository](https://github.com/embulk/embulk-standards) until [`v0.10.42`](https://github.com/embulk/embulk-standards/tree/v0.10.42).
66

7-
### Release
7+
It has been maintained in the standalone repository since `v0.11.0`.
88

9-
#### Prerequisite: Sonatype OSSRH
9+
For Maintainers
10+
----------------
1011

11-
You need an account in [Sonatype OSSRH](https://central.sonatype.org/pages/ossrh-guide.html), and configure it in your `~/.gradle/gradle.properties`.
12+
### Release
13+
14+
Modify `version` in `build.gradle` at a detached commit, and then tag the commit with an annotation.
1215

1316
```
14-
ossrhUsername=(your Sonatype OSSRH username)
15-
ossrhPassword=(your Sonatype OSSRH password)
16-
```
17+
git checkout --detach master
1718
18-
#### Prerequisite: PGP signatures
19+
(Edit: Remove "-SNAPSHOT" in "version" in build.gradle.)
1920
20-
You need your [PGP signatures to release artifacts into Maven Central](https://central.sonatype.org/pages/working-with-pgp-signatures.html), and [configure Gradle to use your key to sign](https://docs.gradle.org/current/userguide/signing_plugin.html).
21+
git add build.gradle
22+
23+
git commit -m "Release vX.Y.Z"
24+
25+
git tag -a vX.Y.Z
2126
27+
(Edit: Write a tag annotation in the changelog format.)
2228
```
23-
signing.keyId=(the last 8 symbols of your keyId)
24-
signing.password=(the passphrase used to protect your private key)
25-
signing.secretKeyRingFile=(the absolute path to the secret key ring file containing your private key)
29+
30+
See [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) for the changelog format. We adopt a part of it for Git's tag annotation like below.
31+
2632
```
33+
## [X.Y.Z] - YYYY-MM-DD
2734
28-
#### Release
35+
### Added
36+
- Added a feature.
2937
30-
Modify `version` in `build.gradle` at a detached commit to bump up the versions of Embulk standard plugins.
38+
### Changed
39+
- Changed something.
40+
41+
### Fixed
42+
- Fixed a bug.
43+
```
44+
45+
Push the annotated tag, then. It triggers a release operation on GitHub Actions after approval.
3146

3247
```
33-
git checkout --detach master
34-
(Remove "-SNAPSHOT" in "version" in build.gradle.)
35-
git add build.gradle
36-
git commit -m "Release vX.Y.Z"
37-
git tag -a vX.Y.Z
38-
(Write the release note for vX.Y.Z in the tag annotation.)
39-
./gradlew clean && ./gradlew release
4048
git push -u origin vX.Y.Z
4149
```

build.gradle

+142-24
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,166 @@
11
plugins {
22
id "java"
33
id "maven-publish"
4-
id "org.embulk.embulk-plugins" version "0.5.5" apply false
4+
id "signing"
5+
id "org.embulk.embulk-plugins" version "0.5.5"
6+
id "checkstyle"
57
}
68

79
repositories {
810
mavenCentral()
911
}
1012

1113
group = "org.embulk"
12-
version = "0.10.42-SNAPSHOT"
14+
version = "0.11.0-SNAPSHOT"
15+
description = "Loads records from Embulk configuration inline."
1316

14-
task releaseCheck {
15-
doFirst {
16-
if (rootProject.version.endsWith("-SNAPSHOT")) {
17-
throw new GradleException("Not for release. The version in build.gradle is SNAPSHOT: ${rootProject.version}")
18-
}
17+
configurations {
18+
compileClasspath.resolutionStrategy.activateDependencyLocking()
19+
runtimeClasspath.resolutionStrategy.activateDependencyLocking()
20+
}
21+
22+
tasks.withType(JavaCompile) {
23+
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
24+
options.encoding = "UTF-8"
25+
}
26+
27+
java {
28+
toolchain {
29+
languageVersion = JavaLanguageVersion.of(8)
1930
}
20-
doLast {
21-
println "Ready. Run 'release' task."
31+
32+
withJavadocJar()
33+
withSourcesJar()
34+
}
35+
36+
dependencies {
37+
compileOnly "org.embulk:embulk-spi:0.11"
38+
compileOnly "org.slf4j:slf4j-api:2.0.7"
39+
40+
implementation "com.fasterxml.jackson.core:jackson-annotations:2.6.7"
41+
implementation "com.fasterxml.jackson.core:jackson-core:2.6.7"
42+
implementation "com.fasterxml.jackson.core:jackson-databind:2.6.7.5"
43+
implementation "org.embulk:embulk-util-config:0.3.3"
44+
implementation "org.embulk:embulk-util-json:0.2.1"
45+
implementation "org.embulk:embulk-util-timestamp:0.2.2"
46+
}
47+
48+
embulkPlugin {
49+
mainClass = "org.embulk.input.config.ConfigInputPlugin"
50+
category = "input"
51+
type = "config"
52+
}
53+
54+
jar {
55+
metaInf {
56+
from rootProject.file("LICENSE")
2257
}
2358
}
2459

25-
task release {
26-
dependsOn "releaseCheck"
60+
sourcesJar {
61+
metaInf {
62+
from rootProject.file("LICENSE")
63+
}
64+
}
65+
66+
javadocJar {
67+
metaInf {
68+
from rootProject.file("LICENSE")
69+
}
2770
}
2871

29-
subprojects {
30-
tasks.withType(Test) {
31-
testLogging {
32-
events "passed", "skipped", "failed", "standardOut", "standardError"
72+
publishing {
73+
publications {
74+
maven(MavenPublication) {
75+
groupId = project.group
76+
artifactId = project.name
3377

34-
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
35-
showCauses = true
36-
showExceptions = true
37-
showStackTraces = true
38-
showStandardStreams = true
78+
from components.java
79+
// javadocJar and sourcesJar are added by java.withJavadocJar() and java.withSourcesJar() above.
80+
// See: https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/JavaPluginExtension.html
3981

40-
outputs.upToDateWhen { false }
82+
pom { // https://central.sonatype.org/pages/requirements.html
83+
packaging "jar"
84+
85+
name = project.name
86+
description = project.description
87+
url = "https://www.embulk.org/"
88+
89+
licenses {
90+
license {
91+
// http://central.sonatype.org/pages/requirements.html#license-information
92+
name = "The Apache License, Version 2.0"
93+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
94+
distribution = "repo"
95+
}
96+
}
97+
98+
developers {
99+
developer {
100+
name = "Dai MIKURUBE"
101+
email = "dmikurube@acm.org"
102+
}
103+
}
104+
105+
scm {
106+
connection = "scm:git:git://github.com/embulk/embulk-input-config.git"
107+
developerConnection = "scm:git:git@github.com:embulk/embulk-input-config.git"
108+
url = "https://github.com/embulk/embulk-input-config"
109+
}
110+
}
41111
}
42112
}
43113

44-
afterEvaluate { project ->
45-
rootProject.check.dependsOn project.check
46-
rootProject.release.dependsOn project.publishMavenPublicationToMavenCentralRepository
114+
repositories {
115+
maven { // publishMavenPublicationToMavenCentralRepository
116+
name = "mavenCentral"
117+
if (project.version.endsWith("-SNAPSHOT")) {
118+
url "https://oss.sonatype.org/content/repositories/snapshots"
119+
} else {
120+
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
121+
}
122+
123+
credentials {
124+
username = project.hasProperty("ossrhUsername") ? ossrhUsername : ""
125+
password = project.hasProperty("ossrhPassword") ? ossrhPassword : ""
126+
}
127+
}
128+
}
129+
}
130+
131+
signing {
132+
if (project.hasProperty("signingKey") && project.hasProperty("signingPassword")) {
133+
logger.lifecycle("Signing with an in-memory key.")
134+
useInMemoryPgpKeys(signingKey, signingPassword)
47135
}
136+
sign publishing.publications.maven
137+
}
138+
139+
test {
140+
testLogging {
141+
events "passed", "skipped", "failed", "standardOut", "standardError"
142+
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
143+
showCauses = true
144+
showExceptions = true
145+
showStackTraces = true
146+
showStandardStreams = true
147+
outputs.upToDateWhen { false }
148+
}
149+
}
150+
151+
tasks.withType(Checkstyle) {
152+
reports {
153+
// Not to skip up-to-date checkstyles.
154+
outputs.upToDateWhen { false }
155+
}
156+
}
157+
158+
checkstyle {
159+
toolVersion "8.7"
160+
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
161+
configProperties = [
162+
"checkstyle.config.path": file("${projectDir}/config/checkstyle")
163+
]
164+
ignoreFailures = false
165+
maxWarnings = 0 // https://github.com/gradle/gradle/issues/881
48166
}

0 commit comments

Comments
 (0)