Skip to content

Commit

Permalink
Add actual README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed Jun 20, 2023
1 parent f044195 commit b2892d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Gradle Galaxy

**WIP** A Gradle plugin to simplify the process of creating projects
A Gradle plugin to simplify the process of creating projects. Thank you [dkim19375](https://github.com/dkim19375) for the help with some stuff :)

## Installation

You can install the plugin just like any other Gradle plugin by adding it to your plugins block. Make sure to replace `VERSION` with your [desired version](https://plugins.gradle.org/plugin/xyz.srnyx.gradle-galaxy). *Currently only supports Kotlin DSL!*

```kotlin
plugins {
id("xyz.srnyx.gradle-galaxy") version "VERSION"
}
```

## Documentation

For the full documentation, please go here: [github.com/srnyx/gradle-galaxy/wiki](https://github.com/srnyx/gradle-galaxy/wiki)
18 changes: 8 additions & 10 deletions src/main/kotlin/xyz/srnyx/gradlegalaxy/utility/Scripts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ fun Project.setTextEncoding(encoding: String = "UTF-8") {
*
* @param javaVersion The java version to set (example: [JavaVersion.VERSION_1_8])
*/
fun Project.setJavaVersion(javaVersion: JavaVersion = JavaVersion.VERSION_1_8) {
fun Project.setJavaVersion(version: JavaVersion = JavaVersion.VERSION_1_8) {
val java: JavaPluginExtension = getJavaExtension()
java.sourceCompatibility = javaVersion
java.targetCompatibility = javaVersion
java.sourceCompatibility = version
java.targetCompatibility = version
}

/**
Expand Down Expand Up @@ -161,8 +161,8 @@ inline fun Project.setupPublishing(
withJavadocSourcesJars: Boolean = true,
component: SoftwareComponent? = components["java"],
artifacts: Collection<Any> = emptyList(),
name: String? = null,
description: String? = null,
name: String? = project.name,
description: String? = project.description,
url: String? = null,
licenses: List<LicenseData> = emptyList(),
developers: List<DeveloperData> = emptyList(),
Expand Down Expand Up @@ -237,20 +237,18 @@ fun Project.setupMC(
javaVersion: JavaVersion? = null,
replacements: Map<String, () -> String>? = mapOf(
"name" to name::toString,
"version" to version::toString
),
"version" to version::toString),
textEncoding: String? = "UTF-8",
artifactClassifier: String? = "",
archiveClassifier: String? = "",
) {
apply(plugin = "java")
this.group = group
this.version = version
dependency?.let { dependencies.add("compileOnly", it) }
javaVersion?.let(::setJavaVersion)
replacements?.let(::addReplacementsTask)
textEncoding?.let(::setTextEncoding)
if (hasShadowPlugin()) {
artifactClassifier?.let(::setShadowArchiveClassifier)
archiveClassifier?.let(::setShadowArchiveClassifier)
addBuildShadowTask()
}
}
Expand Down

0 comments on commit b2892d6

Please sign in to comment.