Skip to content

Commit a6c44d0

Browse files
committed
Proper API update
1 parent f1fbf37 commit a6c44d0

File tree

5 files changed

+91
-35
lines changed

5 files changed

+91
-35
lines changed

.github/workflows/gradle_build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: gradle_build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v2
14+
15+
- name: Set up JDK
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
20+
- name: Change wrapper permissions
21+
run: chmod +x ./gradlew
22+
23+
- name: Gradle cache
24+
uses: actions/cache@v2
25+
with:
26+
path: |
27+
~/.gradle/caches
28+
~/.gradle/wrapper
29+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
30+
restore-keys: |
31+
${{ runner.os }}-gradle-
32+
33+
- name: Gradle build
34+
run: ./gradlew --build-cache build
35+
36+
- name: Archive artifact
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: artifact
40+
path: build/libs

build.gradle

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'net.minecraftforge.gradle:ForgeGradle:4.+'
11+
classpath 'net.minecraftforge.gradle:ForgeGradle:5.+'
1212
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1414
}
1515
}
1616

@@ -19,28 +19,27 @@ apply plugin: 'kotlin'
1919
apply plugin: 'net.minecraftforge.gradle'
2020
apply plugin: 'org.spongepowered.mixin'
2121

22-
compileKotlin {
23-
kotlinOptions {
24-
jvmTarget = "1.8"
25-
useIR = true
26-
freeCompilerArgs += '-Xlambdas=indy'
27-
}
28-
}
29-
3022
compileJava {
3123
sourceCompatibility = targetCompatibility = '1.8'
3224
options.encoding = 'UTF-8'
3325
}
3426

27+
compileKotlin.kotlinOptions {
28+
freeCompilerArgs += '-Xlambdas=indy'
29+
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
30+
freeCompilerArgs += '-Xopt-in=kotlin.contracts.ExperimentalContracts'
31+
}
32+
3533
repositories {
3634
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
3735
maven { url = 'https://impactdevelopment.github.io/maven/' }
3836
maven { url = "https://jitpack.io" }
37+
mavenCentral()
3938
}
4039

4140

4241
minecraft {
43-
mappings channel: 'stable', version: '39-1.12'
42+
mappings channel: "$mappingsChannel", version: "$mappingsVersion"
4443

4544
runs {
4645
client {
@@ -51,12 +50,6 @@ minecraft {
5150

5251
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
5352
property 'forge.logging.console.level', 'debug'
54-
55-
mods {
56-
pluginexample {
57-
source sourceSets.main
58-
}
59-
}
6053
}
6154
}
6255
}
@@ -72,13 +65,12 @@ configurations {
7265
}
7366

7467
dependencies {
75-
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
68+
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"
7669

77-
// API coming soon
78-
// implementation 'com.github.lambda-client:lambda:2.06'
79-
implementation(files("lib/lambda-3.1-api.jar"))
70+
// Online maven dependency coming soon
71+
implementation files("lib/lambda-3.1-api.jar")
8072

81-
implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
73+
implementation('org.spongepowered:mixin:0.8.3') {
8274
exclude module: 'commons-io'
8375
exclude module: 'gson'
8476
exclude module: 'guava'
@@ -87,51 +79,69 @@ dependencies {
8779
}
8880

8981
// Hacky way to get mixin work
90-
annotationProcessor('org.spongepowered:mixin:0.8.2:processor') {
82+
annotationProcessor('org.spongepowered:mixin:0.8.3:processor') {
9183
exclude module: 'gson'
9284
}
9385

9486
// Kotlin libs
9587
// kotlin-stdlib-common and annotations aren't required at runtime
96-
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") {
88+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion") {
9789
exclude module: 'kotlin-stdlib-common'
9890
exclude module: 'annotations'
9991
}
10092

101-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
93+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion") {
10294
exclude module: 'kotlin-stdlib-common'
10395
exclude module: 'annotations'
10496
}
10597

106-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
98+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") {
10799
exclude module: 'kotlin-stdlib-common'
108100
exclude module: 'annotations'
109101
}
110102

111-
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") {
103+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") {
112104
exclude module: 'kotlin-stdlib-common'
113105
exclude module: 'annotations'
114106
}
115107

116-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version") {
108+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") {
117109
exclude module: 'kotlin-stdlib-common'
118110
exclude module: 'annotations'
119111
}
120112

121113
// Add them back to compileOnly (provided)
122-
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
123-
compileOnly 'org.jetbrains:annotations:20.1.0'
114+
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
115+
compileOnly 'org.jetbrains:annotations:23.0.0'
124116

125117
// This Baritone will NOT be included in the jar
126118
implementation 'com.github.cabaletta:baritone:1.2.14'
127119

120+
// Unit Testing frameworks
121+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
122+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
123+
128124
// Add your dependencies below
129125
// jarLibs 'com.lambda:example:1.0.0'
130126
}
131127

132128
mixin {
133129
defaultObfuscationEnv 'searge'
134-
add sourceSets.main, 'mixins.lambda.refmap.json'
130+
add sourceSets.main, 'mixins.ExamplePlugin.refmap.json'
131+
}
132+
133+
processResources {
134+
exclude '**/rawimagefiles'
135+
136+
from(sourceSets.main.resources.srcDirs) {
137+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
138+
include 'plugin_info.json'
139+
expand 'version': project.version
140+
}
141+
}
142+
143+
test {
144+
useJUnitPlatform()
135145
}
136146

137147
jar.finalizedBy('reobfJar')

gradle.properties

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
kotlin.code.style=official
21
org.gradle.jvmargs=-Xmx3G
2+
org.gradle.parallel=true
3+
34
modGroup=com.lambda
45
modVersion=1.2
5-
kotlin_version=1.5.20
6-
kotlinx_coroutines_version=1.5.0
7-
org.gradle.parallel=true
6+
7+
minecraftVersion=1.12.2
8+
forgeVersion=14.23.5.2860
9+
mappingsChannel=stable
10+
mappingsVersion=39-1.12
11+
12+
kotlinVersion=1.6.20
13+
kotlinxCoroutinesVersion=1.6.1

lib/lambda-3.1-api-source.jar

1.31 MB
Binary file not shown.

lib/lambda-3.1-api.jar

3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)