-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull Changelog into its own plugin, if you want to use it without the…
… rest of the utils. Use recommended method of sharing task outputs between sub-projects. https://docs.gradle.org/current/samples/sample_cross_project_output_sharing.html
- Loading branch information
Showing
11 changed files
with
307 additions
and
333 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
55 changes: 0 additions & 55 deletions
55
src/main/groovy/net/minecraftforge/gradleutils/ChangelogGenerationExtension.java
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
54 changes: 54 additions & 0 deletions
54
src/main/groovy/net/minecraftforge/gradleutils/changelog/ChangelogExtension.groovy
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,54 @@ | ||
/* | ||
* Copyright (c) Forge Development LLC and contributors | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
package net.minecraftforge.gradleutils.changelog | ||
|
||
import groovy.transform.PackageScope | ||
import org.gradle.api.Project | ||
import org.gradle.api.file.Directory | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.api.tasks.TaskProvider | ||
|
||
import javax.inject.Inject | ||
|
||
class ChangelogExtension { | ||
public static final String NAME = "changelog" | ||
|
||
@PackageScope final Project project | ||
@PackageScope TaskProvider<GenerateChangelog> task | ||
|
||
boolean publishAll = true | ||
Directory gitRoot | ||
|
||
@Inject | ||
ChangelogExtension(Project project) { | ||
this.project = project | ||
} | ||
|
||
void fromBase() { | ||
from(null) | ||
} | ||
|
||
void from(String marker) { | ||
task = ChangelogUtils.setupChangelogTask(this.project) | ||
task.configure { | ||
start = marker | ||
} | ||
|
||
project.afterEvaluate { | ||
if (gitRoot != null) { | ||
task.configure { | ||
gitDirectory = gitRoot | ||
} | ||
} | ||
|
||
if (publishAll) | ||
ChangelogUtils.setupChangelogGenerationOnAllPublishTasks(project) | ||
} | ||
} | ||
|
||
void publish(MavenPublication publication) { | ||
ChangelogUtils.setupChangelogGenerationForPublishing(project, publication) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/groovy/net/minecraftforge/gradleutils/changelog/ChangelogPlugin.groovy
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,20 @@ | ||
/* | ||
* Copyright (c) Forge Development LLC and contributors | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
*/ | ||
package net.minecraftforge.gradleutils.changelog | ||
|
||
import groovy.transform.CompileStatic | ||
import net.minecraftforge.gradleutils.GradleUtils | ||
import net.minecraftforge.gradleutils.GradleUtilsExtension | ||
import net.minecraftforge.gradleutils.changelog.ChangelogExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
@CompileStatic | ||
class ChangelogPlugin implements Plugin<Project> { | ||
@Override | ||
void apply(Project project) { | ||
project.extensions.create(ChangelogExtension.NAME, ChangelogExtension, project) | ||
} | ||
} |
Oops, something went wrong.