Skip to content

Commit 612e189

Browse files
committed
Update to Lambda 3.1 Standard
1 parent 628466d commit 612e189

16 files changed

Lines changed: 1275 additions & 147 deletions

.editorconfig

Lines changed: 1038 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/gradle_build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ jobs:
1212
- name: Check out repository
1313
uses: actions/checkout@v2
1414

15-
- name: Check out submodules
16-
uses: snickerbockers/submodules-init@v4
17-
1815
- name: Set up JDK
1916
uses: actions/setup-java@v1
2017
with:
@@ -32,6 +29,7 @@ jobs:
3229
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
3330
restore-keys: |
3431
${{ runner.os }}-gradle-
32+
3533
- name: Gradle build
3634
run: ./gradlew --build-cache build
3735

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.2855'
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-2.07.xx-dev-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: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
org.gradle.jvmargs=-Xmx3G
2-
modGroup=com.lambda
3-
modVersion=2.0.2
4-
kotlin_version=1.5.20
5-
kotlinx_coroutines_version=1.5.0-RC
6-
org.gradle.parallel=true
2+
org.gradle.parallel=true
3+
4+
modGroup=dev.toxicaven
5+
modVersion=2.1
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.10
13+
kotlinxCoroutinesVersion=1.6.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

lib/lambda-2.07.xx-dev-api.jar

-3.05 MB
Binary file not shown.

lib/lambda-3.1-api-source.jar

1.31 MB
Binary file not shown.

lib/lambda-3.1-api.jar

3.47 MB
Binary file not shown.

settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

setupWorkspace.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
# Used to setup workspace and fix building on unix / Git BASH
4+
#
5+
# Usage: "./setupWorkspace.sh"
6+
7+
#
8+
9+
# To allow use from outside the lambda directory
10+
cd "$(dirname "$0")" || exit
11+
12+
echo "[$(date +"%H:%M:%S")] Running gradlew classes without daemon..."
13+
./gradlew --no-daemon classes || {
14+
echo "[$(date +"%H:%M:%S")] ERROR: Running gradlew build failed! Run './gradlew --no-daemon classes' manually"
15+
exit 1
16+
}
17+
18+
cat logo_ascii.txt 2>/dev/null
19+
echo "=========================================================================="
20+
echo ""
21+
echo "[$(date +"%H:%M:%S")] Build succeeded! All checks passed, you can build normally now! Welcome to Lambda."
22+
echo ""
23+
echo "=========================================================================="

0 commit comments

Comments
 (0)