Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Commit

Permalink
fix impl class for Kotlin and Java library, fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Feb 17, 2023
1 parent 9510c99 commit 9b81ef8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 10 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import java.io.StringReader
import java.util.Properties

plugins {
id("com.gradle.plugin-publish")
id("com.diffplug.spotless")

`java-gradle-plugin`
Expand Down Expand Up @@ -74,6 +73,8 @@ spotless {
}

gradlePlugin {
isAutomatedPublishing = false

@Suppress("UnstableApiUsage")
vcsUrl by "https://github.com/Noelware/gradle-infra"

Expand All @@ -91,12 +92,12 @@ gradlePlugin {
}

create("kotlin-library") {
implementationClass = "org.noelware.infra.gradle.plugins.module.KotlinLibraryPlugin"
implementationClass = "org.noelware.infra.gradle.plugins.library.KotlinLibraryPlugin"
id = "org.noelware.gradle.kotlin-library"
}

create("java-library") {
implementationClass = "org.noelware.infra.gradle.plugins.module.JavaLibraryPlugin"
implementationClass = "org.noelware.infra.gradle.plugins.library.JavaLibraryPlugin"
id = "org.noelware.gradle.java-library"
}

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ plugins {

repositories {
maven("https://maven.floofy.dev/repo/releases")
maven("https://maven.noelware.org")
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.15.0")
implementation("com.gradle.publish:plugin-publish-plugin:1.1.0")
implementation("org.noelware.gradle:gradle-infra-plugin:1.0.0")
implementation("dev.floofy.commons:gradle:2.5.0")
implementation(kotlin("gradle-plugin", "1.8.10"))
implementation(gradleApi())
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Metadata.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ package org.noelware.infra.gradle
import org.gradle.api.JavaVersion
import dev.floofy.utils.gradle.*

val VERSION = Version(1, 0, 0, showPatchNumber = true)
val VERSION = Version(1, 0, 1, showPatchNumber = true)
val JAVA_VERSION = JavaVersion.VERSION_17
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
import org.noelware.infra.gradle.plugins.module.JavaModulePlugin;
import org.noelware.infra.gradle.plugins.module.NoelwareModuleExtension;

/**
* A plugin that is meant to be used with library projects. This configures the {@link JavaModulePlugin} alongside
* with this, but, this should be only for projects that are Java libraries.
*/
public class JavaLibraryPlugin implements Plugin<Project> {
@Override
public void apply(@NotNull Project project) {
Expand Down Expand Up @@ -150,7 +154,7 @@ public void apply(@NotNull Project project) {

publishing.repositories((repositories) -> {
repositories.maven((maven) -> {
maven.setUrl(ext.getS3BucketUrl().get());
maven.setUrl(ext.getS3BucketUrl().getOrElse("s3://august/noelware/maven"));
maven.credentials(AwsCredentials.class, (creds) -> {
creds.setAccessKey(publishingProps.getProperty("s3.accessKey"));
creds.setSecretKey(publishingProps.getProperty("s3.secretKey"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@
import org.gradle.jvm.tasks.Jar;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.dokka.gradle.AbstractDokkaTask;
import org.noelware.infra.gradle.plugins.module.KotlinModulePlugin;
import org.noelware.infra.gradle.plugins.module.NoelwareModuleExtension;

/**
* A plugin that is meant to be used with library projects. This configures the {@link KotlinModulePlugin} alongside
* with this, but, this should be only for projects that are Kotlin libraries.
*/
public class KotlinLibraryPlugin implements Plugin<Project> {
@Override
public void apply(@NotNull Project project) {
project.getPlugins().apply(KotlinLibraryPlugin.class);
project.getPlugins().apply(KotlinModulePlugin.class);
project.getPlugins().apply("java-library");
project.getPlugins().apply("maven-publish");
project.getPlugins().apply("org.jetbrains.dokka");
Expand Down Expand Up @@ -108,7 +113,7 @@ public void apply(@NotNull Project project) {

publishing.repositories((repositories) -> {
repositories.maven((maven) -> {
maven.setUrl(ext.getS3BucketUrl().get());
maven.setUrl(ext.getS3BucketUrl().getOrElse("s3://august/noelware/maven"));
maven.credentials(AwsCredentials.class, (creds) -> {
creds.setAccessKey(publishingProps.getProperty("s3.accessKey"));
creds.setSecretKey(publishingProps.getProperty("s3.secretKey"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
import org.jetbrains.annotations.NotNull;
import org.noelware.infra.gradle.Licenses;

/**
* Represents the base plugin for configuring Java projects.
*/
public class JavaModulePlugin implements Plugin<Project> {
@Override
public void apply(@NotNull Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
import org.noelware.infra.gradle.Licenses;

/**
* Represents the base plugin for configuring Kotlin projects.
*/
public class KotlinModulePlugin implements Plugin<Project> {
@Override
public void apply(@NotNull Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

implementation-class=org.noelware.infra.gradle.plugins.module.JavaLibraryPlugin
implementation-class=org.noelware.infra.gradle.plugins.library.JavaLibraryPlugin
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

implementation-class=org.noelware.infra.gradle.plugins.module.KotlinLibraryPlugin
implementation-class=org.noelware.infra.gradle.plugins.library.KotlinLibraryPlugin

0 comments on commit 9b81ef8

Please sign in to comment.