Skip to content

Commit 561c201

Browse files
authored
Merge pull request #1 from meshtastic/jamesarich/dependency-audit-update
chore: audit and update dependencies, CI actions, and Gradle APIs
2 parents 34b3b89 + f65c9da commit 561c201

10 files changed

Lines changed: 32 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
gradle: ['9.5.1']
1616
steps:
17-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@v6
1818

1919
- uses: actions/setup-java@v5
2020
with:
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Upload test reports
3232
if: failure()
33-
uses: actions/upload-artifact@v4
33+
uses: actions/upload-artifact@v7
3434
with:
3535
name: test-reports-gradle-${{ matrix.gradle }}
3636
path: plugin/build/reports/

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: read
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515

1616
- uses: actions/setup-java@v5
1717
with:

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: read
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515

1616
- uses: actions/setup-java@v5
1717
with:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.1.0] - Unreleased
8+
## [0.1.2] - Unreleased
99

1010
### Added
1111

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Apply the settings plugin in `settings.gradle.kts` — it captures every depende
1414
```kotlin
1515
// settings.gradle.kts
1616
plugins {
17-
id("org.meshtastic.flatpak.sources.settings") version "0.1.0"
17+
id("org.meshtastic.flatpak.sources.settings") version "0.1.2"
1818
}
1919
```
2020

@@ -43,7 +43,7 @@ If your project uses an included build for convention plugins, apply the setting
4343
```kotlin
4444
// build-logic/settings.gradle.kts
4545
plugins {
46-
id("org.meshtastic.flatpak.sources.settings") version "0.1.0"
46+
id("org.meshtastic.flatpak.sources.settings") version "0.1.2"
4747
}
4848
```
4949

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
22
org.gradle.parallel=true
3+
org.gradle.caching=true
34
version=0.1.2

plugin/src/functionalTest/kotlin/org/meshtastic/flatpak/sources/FlatpakSourcesPluginFunctionalTest.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ package org.meshtastic.flatpak.sources
1010

1111
import org.gradle.testkit.runner.GradleRunner
1212
import org.gradle.testkit.runner.TaskOutcome
13+
import org.junit.jupiter.api.io.TempDir
1314
import java.io.File
15+
import java.nio.file.Path
1416
import kotlin.test.Test
1517
import kotlin.test.assertEquals
1618
import kotlin.test.assertTrue
1719

1820
class FlatpakSourcesPluginFunctionalTest {
1921

22+
@TempDir
23+
lateinit var tempDir: Path
24+
2025
@Test
2126
fun `plugin applies successfully and task exists`() {
2227
val projectDir = createTempProject()
@@ -67,7 +72,7 @@ class FlatpakSourcesPluginFunctionalTest {
6772

6873
@Test
6974
fun `multi-module project works`() {
70-
val projectDir = createTempDir("flatpak-multimodule")
75+
val projectDir = tempDir.resolve("multimodule").toFile().apply { mkdirs() }
7176
File(projectDir, "settings.gradle.kts").writeText(
7277
"""
7378
rootProject.name = "multi-module-test"
@@ -105,7 +110,7 @@ class FlatpakSourcesPluginFunctionalTest {
105110

106111
@Test
107112
fun `settings plugin applies project plugin and task exists`() {
108-
val projectDir = createTempDir("flatpak-settings")
113+
val projectDir = tempDir.resolve("settings").toFile().apply { mkdirs() }
109114
File(projectDir, "settings.gradle.kts").writeText(
110115
"""
111116
plugins {
@@ -128,7 +133,7 @@ class FlatpakSourcesPluginFunctionalTest {
128133

129134
@Test
130135
fun `settings plugin captures URLs without init script warning`() {
131-
val projectDir = createTempDir("flatpak-settings-capture")
136+
val projectDir = tempDir.resolve("settings-capture").toFile().apply { mkdirs() }
132137
File(projectDir, "settings.gradle.kts").writeText(
133138
"""
134139
plugins {
@@ -165,7 +170,7 @@ class FlatpakSourcesPluginFunctionalTest {
165170

166171
@Test
167172
fun `settings plugin works with included build reuse pattern`() {
168-
val projectDir = createTempDir("flatpak-reuse")
173+
val projectDir = tempDir.resolve("reuse").toFile().apply { mkdirs() }
169174
File(projectDir, "settings.gradle.kts").writeText(
170175
"""
171176
plugins {
@@ -187,7 +192,7 @@ class FlatpakSourcesPluginFunctionalTest {
187192
}
188193

189194
private fun createTempProject(extraConfig: String = ""): File {
190-
val projectDir = createTempDir("flatpak-sources-test")
195+
val projectDir = tempDir.resolve("project").toFile().apply { mkdirs() }
191196
File(projectDir, "settings.gradle.kts").writeText(
192197
"""
193198
rootProject.name = "test-project"

plugin/src/main/kotlin/org/meshtastic/flatpak/sources/FlatpakSourcesPlugin.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package org.meshtastic.flatpak.sources
1818

1919
import org.gradle.api.Plugin
2020
import org.gradle.api.Project
21-
import org.gradle.api.artifacts.ModuleVersionIdentifier
21+
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
2222
import org.gradle.api.internal.project.ProjectInternal
2323
import org.gradle.internal.operations.BuildOperationDescriptor
2424
import org.gradle.internal.operations.BuildOperationListener
@@ -161,13 +161,14 @@ class FlatpakSourcesPlugin : Plugin<Project> {
161161
.filter { !it.startsWith("file:") }
162162

163163
return try {
164-
config.resolvedConfiguration.resolvedArtifacts.flatMap { artifact ->
165-
val mid = artifact.moduleVersion.id
164+
config.incoming.artifacts.artifacts.flatMap { artifact ->
165+
val componentId = artifact.id.componentIdentifier
166+
if (componentId !is ModuleComponentIdentifier) return@flatMap emptyList()
166167
project.logger.lifecycle(
167168
"flatpak-sources: force-resolved {} (platform artifact)",
168-
"${mid.group}:${mid.name}:${mid.version}",
169+
"${componentId.group}:${componentId.module}:${componentId.version}",
169170
)
170-
artifactToUrls(mid, artifact.file.name, repoUrls)
171+
artifactToUrls(componentId, artifact.file.name, repoUrls)
171172
}
172173
} catch (@Suppress("TooGenericExceptionCaught") e: Exception) {
173174
project.logger.warn("flatpak-sources: platform resolution failed — {}", e.message)
@@ -176,14 +177,14 @@ class FlatpakSourcesPlugin : Plugin<Project> {
176177
}
177178

178179
private fun artifactToUrls(
179-
mid: ModuleVersionIdentifier,
180+
mid: ModuleComponentIdentifier,
180181
filename: String,
181182
repoUrls: List<String>,
182183
): List<String> {
183184
val groupPath = mid.group.replace('.', '/')
184-
val pomFile = "${mid.name}-${mid.version}.pom"
185+
val pomFile = "${mid.module}-${mid.version}.pom"
185186
return repoUrls.flatMap { repoUrl ->
186-
val base = "$repoUrl/$groupPath/${mid.name}/${mid.version}"
187+
val base = "$repoUrl/$groupPath/${mid.module}/${mid.version}"
187188
buildList {
188189
add("$base/$filename")
189190
if (filename != pomFile) add("$base/$pomFile")

plugin/src/main/kotlin/org/meshtastic/flatpak/sources/FlatpakSourcesSettingsPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import java.util.concurrent.ConcurrentHashMap
4646
* ```kotlin
4747
* // settings.gradle.kts
4848
* plugins {
49-
* id("org.meshtastic.flatpak.sources.settings") version "0.1.0"
49+
* id("org.meshtastic.flatpak.sources.settings") version "0.1.2"
5050
* }
5151
* ```
5252
*/

settings.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ dependencyResolutionManagement {
1111
}
1212
}
1313

14+
plugins {
15+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
16+
}
17+
1418
rootProject.name = "gradle-flatpak-sources"
1519
include(":plugin")

0 commit comments

Comments
 (0)