Skip to content

Commit 3248d66

Browse files
authored
Merge pull request #38 from MGross21/fix/dependencies
Modernize Build System and Improve CI Workflows
2 parents 91e5fba + 07b7fbc commit 3248d66

File tree

10 files changed

+111
-126
lines changed

10 files changed

+111
-126
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ updates:
77
interval: "daily"
88
labels:
99
- "dependencies"
10+
ignore:
11+
- dependency-name: "gradle"
12+
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
13+
- dependency-name: "org.jlleitschuh.gradle.ktlint"
14+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
1015
groups:
1116
# Group PR for all FTC SDK dependencies
1217
ftc-sdk:

.github/workflows/ktlint.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ jobs:
1919
ref: ${{ github.event.pull_request.head.ref || github.ref }}
2020
token: ${{ secrets.GITHUB_TOKEN }}
2121

22-
- uses: actions/setup-java@v5
23-
with:
24-
java-version: '17'
25-
distribution: 'temurin'
26-
27-
- name: Setup Gradle
28-
uses: gradle/actions/setup-gradle@v5
29-
30-
- name: Make gradlew executable
31-
run: chmod +x ./gradlew
22+
- uses: actions/setup-java@v5
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
27+
- name: Setup Gradle
28+
uses: gradle/actions/setup-gradle@v5
29+
30+
- name: Make gradlew executable
31+
run: chmod +x ./gradlew
3232

33-
- name: Format (non-fork) or check (fork)
34-
run: |
35-
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" && "${{ github.event_name }}" == "pull_request" ]]; then
36-
./gradlew ktlintCheck --no-daemon
37-
else
38-
./gradlew ktlintFormat --no-daemon
39-
fi
33+
- name: Run ktlint
34+
run: |
35+
if [[ "${{ github.event_name }}" == "push" || "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
36+
./gradlew ktlintCheck --no-daemon
37+
else
38+
./gradlew ktlintFormat --no-daemon
39+
fi
4040
41-
- name: Commit formatting changes
42-
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
43-
run: |
44-
if [[ -n $(git status --porcelain) ]]; then
45-
git config user.email "github-actions[bot]@users.noreply.github.com"
46-
git config user.name "github-actions[bot]"
47-
git add .
48-
git commit -m "style: apply ktlint formatting [bot]"
49-
git push
50-
fi
41+
- name: Commit formatting changes
42+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
43+
run: |
44+
if [[ -n $(git status --porcelain) ]]; then
45+
git config user.email "github-actions[bot]@users.noreply.github.com"
46+
git config user.name "github-actions[bot]"
47+
git add .
48+
git commit -m "style: apply ktlint formatting [bot]"
49+
git push
50+
fi

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ lint/tmp/
8585
# lint/reports/
8686

8787
# Others
88-
.venv
88+
.venv
89+
90+
# Kotlin compiler temp files
91+
.kotlin/

README.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,13 @@ For detailed information, refer to the [FTC Robot Controller repository README](
88

99
For official Java documentation, visit the [FTC JavaDocs](https://javadoc.io/doc/org.firstinspires.ftc).
1010

11-
## Keeping the Repository Updated
11+
## Keeping Repository Updated
1212

13-
To stay aligned with the upstream FTC repository:
13+
@Dependabot will open PR's if any updates are posted.
1414

15-
1. Add the upstream repository:
16-
```bash
17-
git remote add upstream https://github.com/FIRST-Tech-Challenge/FtcRobotController
18-
```
15+
## Adding New Dependencies
1916

20-
2. Fetch the latest updates:
21-
```bash
22-
git fetch upstream
23-
```
24-
25-
3. Merge the updates:
26-
```bash
27-
git merge upstream/master
28-
```
29-
30-
4. Address any merge conflicts as necessary.
17+
See [`gradle/libs.versions.toml`](gradle/libs.versions.toml)
3118

3219
## Formatting Kotlin Code
3320

TeamCode/build.gradle

Lines changed: 0 additions & 75 deletions
This file was deleted.

TeamCode/build.gradle.kts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// build.gradle in TeamCode
3+
//
4+
// Most of the definitions for building your module reside in a common, shared
5+
// file 'build.common.gradle'. Being factored in this way makes it easier to
6+
// integrate updates to the FTC into your code. If you really need to customize
7+
// the build definitions, you can place those customizations in this file, but
8+
// please think carefully as to whether such customizations are really necessary
9+
// before doing so.
10+
11+
12+
// Custom definitions may go here
13+
14+
// ktlint configuration - plugins block must come before apply statements
15+
plugins {
16+
id("com.android.application")
17+
id("org.jlleitschuh.gradle.ktlint") version "13.1.0"
18+
id("org.jetbrains.kotlin.android")
19+
}
20+
21+
// Include common definitions from above.
22+
apply { from("../build.common.gradle") }
23+
24+
ktlint {
25+
android = true
26+
ignoreFailures = true // Allow build to succeed, but still show warnings
27+
28+
// Disable ktlint check tasks to prevent build failures
29+
filter {
30+
exclude("**/build/**")
31+
}
32+
}
33+
34+
android {
35+
namespace = "pioneer"
36+
kotlinOptions {
37+
jvmTarget = "1.8"
38+
}
39+
40+
packagingOptions {
41+
jniLibs {
42+
useLegacyPackaging = true
43+
}
44+
}
45+
}
46+
47+
dependencies {
48+
implementation(project(":FtcRobotController"))
49+
implementation(libs.ftc.inspection)
50+
implementation(libs.ftc.blocks)
51+
implementation(libs.ftc.robotcore)
52+
implementation(libs.ftc.robotserver)
53+
implementation(libs.ftc.onbotjava)
54+
implementation(libs.ftc.hardware)
55+
implementation(libs.ftc.common)
56+
implementation(libs.ftc.vision)
57+
implementation(libs.androidx.appcompat)
58+
implementation(libs.acmerobotics.dashboard)
59+
testImplementation(libs.junit)
60+
}
61+
62+
//kotlin {
63+
// jvmToolchain(8)
64+
//}

TeamCode/src/main/kotlin/pioneer/opmodes/other/ObeliskTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.qualcomm.robotcore.eventloop.opmode.TeleOp
55
import pioneer.Bot
66
import pioneer.decode.Obelisk
77
import pioneer.general.AllianceColor
8+
import pioneer.hardware.Camera
89
import pioneer.opmodes.BaseOpMode
910
import pioneer.vision.AprilTag
1011

build.gradle renamed to build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66

77
buildscript {
8-
ext.kotlin_version = '2.2.21'
8+
val kotlin_version = "2.2.21"
99
repositories {
1010
mavenCentral()
1111
google()
1212
}
1313
dependencies {
1414
// Note for FTC Teams: Do not modify this yourself.
15-
classpath 'com.android.tools.build:gradle:8.7.0'
16-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15+
classpath("com.android.tools.build:gradle:8.7.0")
16+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
1717
}
1818
}
1919

@@ -23,7 +23,7 @@ allprojects {
2323
repositories {
2424
mavenCentral()
2525
google()
26-
maven { url = 'https://maven.brott.dev/' }
26+
maven { url = uri("https://maven.brott.dev/") }
2727
}
2828
}
2929

settings.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include(":FtcRobotController")
2+
include(":TeamCode")

0 commit comments

Comments
 (0)