-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement MavenPublishConfiguration (#12)
- Loading branch information
Showing
17 changed files
with
395 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
buildSrc/src/main/kotlin/co/raccoons/local/gradle/BuildWorkflow.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package co.raccoons.local.gradle | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
/** | ||
* Gradle build configurator. | ||
*/ | ||
object BuildWorkflow { | ||
/** | ||
* Returns build configuration handler of this project. | ||
*/ | ||
fun of(project: Project): ConfigurationHandler { | ||
/** | ||
* Build configuration handler that applies configuration to project. | ||
*/ | ||
class BuildConfigurationHandler(private val project: Project) : ConfigurationHandler { | ||
/** inheritDoc */ | ||
override fun use(plugin: Plugin<Project>): ConfigurationHandler { | ||
plugin.apply(this.project) | ||
return this | ||
} | ||
|
||
/** inheritDoc */ | ||
override fun setGroup(group: String): ConfigurationHandler { | ||
this.project.group = group | ||
return this | ||
} | ||
|
||
/** inheritDoc */ | ||
override fun setVersion(version: String): ConfigurationHandler { | ||
this.project.version = version | ||
return this | ||
} | ||
} | ||
return BuildConfigurationHandler(project) | ||
} | ||
|
||
interface ConfigurationHandler { | ||
/** | ||
* Puts plugin into operation | ||
*/ | ||
fun use(plugin: Plugin<Project>): ConfigurationHandler | ||
|
||
/** | ||
* Sets the group of this project. | ||
* | ||
* @param group The group of this project. | ||
*/ | ||
fun setGroup(group: String): ConfigurationHandler | ||
|
||
/** | ||
* Sets the version of this project. | ||
* | ||
* @param version The version of this project. | ||
*/ | ||
fun setVersion(version: String): ConfigurationHandler | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
buildSrc/src/main/kotlin/co/raccoons/local/gradle/GradleBuild.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
buildSrc/src/main/kotlin/co/raccoons/local/gradle/java/Implementation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright 2023, Raccoons. Developing simple way to change. | ||
* | ||
* @license MIT | ||
*/ | ||
|
||
package co.raccoons.local.gradle.java | ||
|
||
private const val CONFIGURATION_NAME = "implementation" | ||
|
||
class Implementation( | ||
group: String, | ||
name: String, | ||
version: String | ||
) : Dependency(CONFIGURATION_NAME, DependencyNotation(group, name, version)) |
Oops, something went wrong.