-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name-template: 'Draft for v$NEXT_MINOR_VERSION' | ||
tag-template: 'v$NEXT_MINOR_VERSION' | ||
change-template: '- #$NUMBER $TITLE (@$AUTHOR)' | ||
template: | | ||
## Changes | ||
$CHANGES | ||
categories: | ||
- title: ':rocket: Features' | ||
labels: | ||
- 'Enhancement' | ||
- title: ':bug: Bug Fixes' | ||
labels: | ||
- 'Bug' | ||
- title: ':toolbox: Maintenance' | ||
labels: | ||
- 'Stabilization' | ||
- title: ':books: Documentation' | ||
labels: | ||
- 'Documentation' | ||
- title: ':gear: Logistics' | ||
labels: | ||
- 'Logistics' | ||
autolabeler: | ||
- label: 'Documentation' | ||
title: | ||
- '/doc/i' | ||
- label: 'Bug' | ||
title: | ||
- '/fix/i' | ||
- label: 'Enhancement' | ||
title: | ||
- '/feat/i' | ||
- label: 'Logistics' | ||
title: | ||
- '/build/i' | ||
- '/ci/i' | ||
- label: 'Stabilization' | ||
title: | ||
- '/chore/i' | ||
- '/refactor/i' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release Draft | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter-config.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2021 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.gradology | ||
|
||
import org.gradle.api.Project | ||
import org.terasology.module.DependencyInfo | ||
import org.terasology.module.ModuleMetadata | ||
import org.terasology.module.ModuleMetadataJsonAdapter | ||
import org.terasology.naming.Version | ||
import java.io.File | ||
|
||
|
||
// This might be a gradle ExternalModuleDependency or ModuleComponentSelector | ||
// or something else from gradle.api.artifacts, but it exposes no concrete implementation | ||
// of those interfaces. | ||
data class GradleDependencyInfo(val group: String, val module: String, val version: String) { | ||
fun asMap(): Map<String, String> { | ||
return mapOf("group" to group, "name" to module, "version" to version) | ||
} | ||
} | ||
|
||
|
||
class ModuleMetadataForGradle(private val moduleConfig: ModuleMetadata) { | ||
|
||
companion object { | ||
fun fromFile(moduleFile: File, project: Project?): ModuleMetadataForGradle { | ||
val moduleConfig = try { | ||
moduleFile.reader().use { | ||
ModuleMetadataJsonAdapter().read(it)!! | ||
} | ||
} catch (e: Exception) { | ||
throw ModuleInfoException(e, moduleFile, project) | ||
} | ||
|
||
return ModuleMetadataForGradle(moduleConfig) | ||
} | ||
|
||
fun forProject(project: Project): ModuleMetadataForGradle { | ||
return fromFile(project.file(MODULE_INFO_FILENAME), project) | ||
} | ||
} | ||
|
||
val version: Version | ||
get() = moduleConfig.version | ||
|
||
val group: String = TERASOLOGY_MODULES_GROUP | ||
|
||
fun engineVersion(): String { | ||
return moduleConfig.dependencies.filterNotNull() | ||
.find { it.id.toString() == ENGINE_MODULE_NAME } | ||
?.versionRange()?.toString() ?: "+" | ||
} | ||
|
||
/** | ||
* Dependencies declared by this module's metadata. | ||
* | ||
* @return a list of modules and whether each is optional | ||
*/ | ||
fun moduleDependencies(): List<Pair<GradleDependencyInfo, Boolean>> { | ||
val gestaltDeps = moduleConfig.dependencies.filterNotNull().filterNot { it.id.toString() == "engine" } | ||
return gestaltDeps.map { gradleModule(it) } | ||
} | ||
|
||
private fun gradleModule(gestaltDependency: DependencyInfo): Pair<GradleDependencyInfo, Boolean> { | ||
if (!gestaltDependency.minVersion.isSnapshot) { | ||
// gestalt considers snapshots to satisfy a minimum requirement: | ||
// https://github.com/MovingBlocks/gestalt/blob/fe1893821127/gestalt-module/src/main/java/org/terasology/naming/VersionRange.java#L58-L59 | ||
gestaltDependency.minVersion = gestaltDependency.minVersion.snapshot | ||
// (maybe there's some way to do that with a custom gradle resolver? | ||
// but making a resolver that only works that way on gestalt modules specifically | ||
// sounds complicated.) | ||
} | ||
|
||
val gradleDep = GradleDependencyInfo(TERASOLOGY_MODULES_GROUP, gestaltDependency.id.toString(), gestaltDependency.versionRange().toString()) | ||
return Pair(gradleDep, gestaltDependency.isOptional) | ||
} | ||
} |