Skip to content

Commit f9a4712

Browse files
vLuckyyyRollczi
andauthored
GH-91 Refactor gradle module setup. (#91)
* Start of Refactor build scripts for project modularity and clarity * another work * another work * Optimize build configuration and restructure project files * Updated .editorconfig for improved readability and consistency * Add initial Gradle configurations for Java * Refine GitHub Actions workflow to accommodate changes associated with the new module style. * Fix mistake version number. * Removed unnecessary whitespace in build.gradle.kts. * Removed unnecessary whitespace in build.gradle.kts. * Removed universal rules from .editorconfig * Update buildSrc/src/main/kotlin/eternalcode.java.gradle.kts Co-authored-by: Norbert Dejlich <[email protected]> * Update core/build.gradle.kts Co-authored-by: Norbert Dejlich <[email protected]> --------- Co-authored-by: Norbert Dejlich <[email protected]>
1 parent 4b1e1ca commit f9a4712

File tree

52 files changed

+205
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+205
-217
lines changed

.editorconfig

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
[*]
2-
charset=utf-8
3-
end_of_line=lf
4-
insert_final_newline=true
5-
indent_style=space
6-
indent_size=4
7-
8-
[*.tiny]
9-
indent_style=tab
10-
111
[*.bat]
12-
end_of_line=crlf
2+
end_of_line = crlf
3+
4+
[*.yml]
5+
indent_size = 2

.github/workflows/gradle.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
name: Java CI with Gradle
22

3-
on: [ push ]
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
410

511
jobs:
612
build:
13+
714
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
java:
11-
- 17
12-
fail-fast: false
15+
1316
steps:
1417
- name: Checkout
15-
uses: actions/checkout@v4.1.0
16-
- name: 'Set up JDK ${{ matrix.java }}'
17-
uses: actions/setup-java@v3.13.0
18+
uses: actions/checkout@v4
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
1821
with:
19-
distribution: adopt
20-
java-version: '${{ matrix.java }}'
22+
java-version: '17'
23+
distribution: 'temurin'
2124
- name: Cache Gradle
2225
uses: actions/[email protected]
2326
with:
24-
path: ~/.gradle
27+
path: ~/.gradle/caches
2528
key: >-
2629
${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*',
2730
'**/gradle-wrapper.properties') }}
2831
restore-keys: '${{ runner.os }}-gradle-'
29-
- name: Grant execute permission for gradlew
32+
- name: Make gradlew executable
3033
run: chmod +x gradlew
31-
- name: Build the chat-formatter jar
32-
run: './gradlew chat-formatter:shadowJar'
33-
- name: Build the paper-support jar
34-
run: './gradlew paper-support:shadowJar'
35-
- name: Upload a chat-formatter build artifact
34+
- name: Build with Gradle
35+
uses: gradle/gradle-build-action@62cce3c597efd445cd71ee868887b8b1117703a7
36+
with:
37+
arguments: core:shadowJar paper-support:shadowJar
38+
- name: Upload a ChatFormatter Artifact
3639
uses: actions/[email protected]
3740
with:
38-
name: 'Successfully build ChatFormatter JDK${{ matrix.jdk }}'
39-
path: chat-formatter/build/libs/*.jar
40-
- name: Upload a paper-support build artifact
41+
name: 'Successfully build ChatFormatter'
42+
path: core/build/libs/*.jar
43+
- name: Upload a PaperSupport Artifact
4144
uses: actions/[email protected]
4245
with:
43-
name: 'Successfully build paper-support JDK${{ matrix.jdk }}'
44-
path: paper-support/build/libs/*.jar
46+
name: 'Successfully build PaperSupport'
47+
path: paper-support/build/libs/*.jar

build.gradle.kts

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

buildSrc/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}
8+
9+
dependencies {
10+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10")
11+
implementation("com.github.johnrengelman:shadow:8.1.1")
12+
implementation("net.minecrell:plugin-yml:0.6.0")
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
group = "com.eternalcode"
6+
version = "1.0.7"
7+
8+
repositories {
9+
mavenCentral()
10+
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
11+
maven { url = uri("https://repo.panda-lang.org/releases") }
12+
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
13+
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
14+
maven { url = uri("https://jitpack.io") }
15+
maven { url = uri("https://repo.eternalcode.pl/releases") }
16+
}
17+
18+
java {
19+
sourceCompatibility = JavaVersion.VERSION_17
20+
targetCompatibility = JavaVersion.VERSION_17
21+
}
22+
23+
tasks.withType<JavaCompile> {
24+
options.encoding = "UTF-8"
25+
}

0 commit comments

Comments
 (0)