Skip to content

Commit

Permalink
Merge branch 'dev/feature' into feature/toggleChanger
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth authored May 6, 2024
2 parents 14cc4e0 + e4c0a15 commit fa7d13c
Show file tree
Hide file tree
Showing 124 changed files with 3,015 additions and 628 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs/setup-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
ssh-key: ${{ inputs.docs_deploy_key }}
- uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- shell: bash
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/java-17-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java 17 CI (MC 1.17+)
name: Java 17 CI (MC 1.17-1.20.4)

on:
push:
Expand All @@ -17,10 +17,10 @@ jobs:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/java-21-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Java 21 CI (MC 1.20.6+)

on:
push:
branches:
- master
- 'dev/**'
pull_request:

jobs:
build:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Skript and run test scripts
run: ./gradlew clean skriptTestJava21
- name: Upload Nightly Build
uses: actions/upload-artifact@v4
if: success()
with:
name: skript-nightly
path: build/libs/*
4 changes: 2 additions & 2 deletions .github/workflows/java-8-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/junit-17-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JUnit (MC 1.17+)
name: JUnit (MC 1.17-1.20.4)

on:
push:
Expand All @@ -17,10 +17,10 @@ jobs:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/junit-21-builds.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Disabled as EasyMock 5.2.0 is required for Java 21 support
# However, we are currently using 5.0.1 (see https://github.com/SkriptLang/Skript/pull/6204#discussion_r1405302009)
name: JUnit (MC 1.20.6+)

on:
push:
branches:
- master
- 'dev/**'
pull_request:

jobs:
build:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Skript and run JUnit
run: ./gradlew clean JUnitJava21
4 changes: 2 additions & 2 deletions .github/workflows/junit-8-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Publish Skript
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ Skript has some tests written in Skript. Running them requires a Minecraft
server, but our build script will create one for you. Running the tests is easy:

```
./gradlew (quickTest|skriptTest|skriptTestJava8|skriptTestJava17)
./gradlew (quickTest|skriptTest|skriptTestJava8|skriptTestJava17|skriptTestJava21)
```

<code>quickTest</code> runs the test suite on newest supported server version.
<code>skriptTestJava17</code> (1.17+) runs the tests on the latest supported Java version.
<code>skriptTestJava8</code> (1.13-1.16) runs the tests on the oldest supported Java version.
<code>skriptTest</code> runs both skriptTestJava8 and skriptTestJava17
<code>skriptTestJava21</code> (1.20.6+) runs the tests on Java 21 supported versions.
<code>skriptTestJava17</code> (1.17-1.20.4) runs the tests on Java 17 supported versions.
<code>skriptTestJava8</code> (1.13-1.16) runs the tests on Java 8 supported versions.
<code>skriptTest</code> runs the tests on all versions.
That is, it runs skriptTestJava8, skriptTestJava17, and skriptTestJava21.

By running the tests, you agree to Mojang's End User License Agreement.

Expand Down
40 changes: 26 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ allprojects {
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://repo.papermc.io/repository/maven-public/' }
maven { url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } // needed for paper adventure snapshot
maven { url 'https://ci.emc.gs/nexus/content/groups/aikar/' }
}
}
Expand All @@ -29,7 +30,7 @@ dependencies {
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.4-R0.1-SNAPSHOT'
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.6-R0.1-SNAPSHOT'
implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.700'
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT'
Expand Down Expand Up @@ -61,12 +62,12 @@ task testJar(type: ShadowJar) {

task jar(overwrite: true, type: ShadowJar) {
dependsOn checkAliases
archiveFileName = jarName ? 'Skript.jar' : jarName
archiveFileName = jarName ? 'Skript-' + project.version + '.jar' : jarName
from sourceSets.main.output
}

task build(overwrite: true, type: ShadowJar) {
archiveFileName = jarName ? 'Skript.jar' : jarName
archiveFileName = jarName ? 'Skript-' + project.version + '.jar' : jarName
from sourceSets.main.output
}

Expand Down Expand Up @@ -250,9 +251,16 @@ void createTestTask(String name, String desc, String environments, int javaVersi
}
}

def latestEnv = 'java17/paper-1.20.4.json'
def latestJava = 17
def oldestJava = 8
def java21 = 21
def java17 = 17
def java8 = 8

def latestEnv = 'java21/paper-1.20.6.json'
def latestJava = java21
def oldestJava = java8

def latestJUnitEnv = 'java17/paper-1.20.4.json'
def latestJUnitJava = java17

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(latestJava))
Expand All @@ -270,23 +278,27 @@ String environments = 'src/test/skript/environments/';
String env = project.property('testEnv') == null ? latestEnv : project.property('testEnv') + '.json'
int envJava = project.property('testEnvJavaVersion') == null ? latestJava : Integer.parseInt(project.property('testEnvJavaVersion') as String)
createTestTask('quickTest', 'Runs tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0)
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', latestJava, 0)
createTestTask('skriptTestJava8', 'Runs tests on all Java 8 environments.', environments + 'java8', oldestJava, 0)
createTestTask('skriptTestJava21', 'Runs tests on all Java 21 environments.', environments + 'java21', java21, 0)
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', java17, 0)
createTestTask('skriptTestJava8', 'Runs tests on all Java 8 environments.', environments + 'java8', java8, 0)
createTestTask('skriptTestDev', 'Runs testing server and uses \'system.in\' for command input, stop server to finish.', environments + env, envJava, 0, Modifiers.DEV_MODE, Modifiers.DEBUG)
createTestTask('skriptProfile', 'Starts the testing server with JProfiler support.', environments + latestEnv, latestJava, -1, Modifiers.PROFILE)
createTestTask('genNightlyDocs', 'Generates the Skript documentation website html files.', environments + env, envJava, 0, Modifiers.GEN_NIGHTLY_DOCS)
createTestTask('genReleaseDocs', 'Generates the Skript documentation website html files for a release.', environments + env, envJava, 0, Modifiers.GEN_RELEASE_DOCS)
tasks.register('skriptTest') {
description = 'Runs tests on all environments.'
dependsOn skriptTestJava8, skriptTestJava17
dependsOn skriptTestJava8, skriptTestJava17, skriptTestJava21
}

createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', latestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitJava8', 'Runs JUnit tests on all Java 8 environments.', environments + 'java8', oldestJava, 0, Modifiers.JUNIT)
createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestJUnitEnv, latestJUnitJava, 0, Modifiers.JUNIT)
// Disabled as EasyMock 5.2.0 is required for Java 21 support
// However, we are currently using 5.0.1 (see https://github.com/SkriptLang/Skript/pull/6204#discussion_r1405302009)
//createTestTask('JUnitJava21', 'Runs JUnit tests on all Java 21 environments.', environments + 'java21', java21, 0, Modifiers.JUNIT)
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', java17, 0, Modifiers.JUNIT)
createTestTask('JUnitJava8', 'Runs JUnit tests on all Java 8 environments.', environments + 'java8', java8, 0, Modifiers.JUNIT)
tasks.register('JUnit') {
description = 'Runs JUnit tests on all environments.'
dependsOn JUnitJava8, JUnitJava17
dependsOn JUnitJava8, JUnitJava17//, JUnitJava21
}

// Build flavor configurations
Expand All @@ -313,7 +325,7 @@ task githubResources(type: ProcessResources) {
task githubRelease(type: ShadowJar) {
from sourceSets.main.output
dependsOn githubResources
archiveFileName = 'Skript-github.jar'
archiveFileName = 'Skript-' + version +'.jar'
manifest {
attributes(
'Name': 'ch/njol/skript',
Expand Down
4 changes: 2 additions & 2 deletions code-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ Your comments should look something like these:
## Language Features

### Compatibility
* Contributions should maintain Java 8 source/binary compatibility, even though compiling Skript requires Java 17
* Contributions should maintain Java 8 source/binary compatibility, even though compiling Skript requires Java 21
- Users must not need JRE newer than version 8
* Versions up to and including Java 17 should work too
* Versions up to and including Java 21 should work too
- Please avoid using unsafe reflection
* It is recommended to make fields final, if they are effectively final
* Local variables and method parameters should not be declared final
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.parallel=true

groupid=ch.njol
name=skript
version=2.8.4
version=2.8.5
jarName=Skript.jar
testEnv=java17/paper-1.20.4
testEnvJavaVersion=17
testEnv=java21/paper-1.20.6
testEnvJavaVersion=21
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion skript-aliases
Submodule skript-aliases updated 4 files
+128 −0 +global-variations.sk
+9 −76 brewing.sk
+185 −49 combat.sk
+68 −26 misc.sk
Loading

0 comments on commit fa7d13c

Please sign in to comment.