Compare commits
4 Commits
main
...
3d049720a9
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d049720a9 | |||
| 32ab651d6d | |||
| ebdc03b0b4 | |||
| bddcc273cf |
@@ -15,4 +15,5 @@ jobs:
|
|||||||
# cache-dependency-path: | # optional
|
# cache-dependency-path: | # optional
|
||||||
# sub-project/*.gradle*
|
# sub-project/*.gradle*
|
||||||
# sub-project/**/gradle-wrapper.properties
|
# sub-project/**/gradle-wrapper.properties
|
||||||
- run: ./gradlew build --no-daemon
|
- run: ./gradlew build --no-daemon
|
||||||
|
- run: ./gradlew publishAllPublicationsToGiteaRepository -PgradleKey="${{ secrets.GRADLE_KEY }}" --configuration-cache
|
||||||
@@ -1,12 +1,65 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
|
`maven-publish`
|
||||||
|
// Also commonly used for creating source/javadoc JARs
|
||||||
|
id("org.jetbrains.dokka") version "1.9.20"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.softwaresmyth"
|
group = "com.softwaresmyth"
|
||||||
version = "1.0-SNAPSHOT"
|
version = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
val mySecret = project.findProperty("mySecretProperty")
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
// Define a publication, in this case for Maven
|
||||||
|
publications {
|
||||||
|
// other settings of publication
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "Gitea"
|
||||||
|
url = uri("https://gitea.softwaresmyth.com/api/packages/numbers/maven")
|
||||||
|
|
||||||
|
credentials(HttpHeaderCredentials::class) {
|
||||||
|
name = "Authorization"
|
||||||
|
value = "token $mySecret"
|
||||||
|
}
|
||||||
|
|
||||||
|
authentication {
|
||||||
|
create<HttpHeaderAuthentication>("header")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
create<MavenPublication>("Smythery") {
|
||||||
|
// Specify which component to publish (usually "java" for a standard library)
|
||||||
|
from(components["java"])
|
||||||
|
|
||||||
|
// Optional: Customize POM metadata (required for Maven Central)
|
||||||
|
pom {
|
||||||
|
name = "Ornot"
|
||||||
|
description = "A library of methods that do nothing"
|
||||||
|
url = "https://gitea.softwaresmyth.com/numbers/Ornot"
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = "The Apache License, Version 2.0"
|
||||||
|
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = "Numbers"
|
||||||
|
name = "Josh Chester"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
// other repositories
|
||||||
|
maven { url = uri("https://gitea.softwaresmyth.com/api/packages/numbers/maven") }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -2,5 +2,10 @@
|
|||||||
|
|
||||||
A ridiculous library that...does nothing.
|
A ridiculous library that...does nothing.
|
||||||
Contained are three methods that together cover every possible method signature.
|
Contained are three methods that together cover every possible method signature.
|
||||||
|
Any instance where a method reference is expected and a no-op is needed can be covered by one of these three methods.
|
||||||
|
|
||||||
Any instance where a method reference is expected and a no-op is needed can be covered by one of these three methods.
|
This project came about when I realized an `Object...` parameter might satisfy the type system for methods
|
||||||
|
that expected any combination of parameters. Turns out it does, including methods that take no arguments
|
||||||
|
such as implementations of `Supplier<T>`.
|
||||||
|
|
||||||
|
It continues here as my go-to place for learning CI actions with a small java project.
|
||||||
|
|||||||
Reference in New Issue
Block a user