Skip to content

Commit

Permalink
Merge branch 'dev/feature' into ench/regex-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Moderocky authored Apr 10, 2024
2 parents 255696e + b5160e2 commit 73da21b
Show file tree
Hide file tree
Showing 343 changed files with 12,242 additions and 5,026 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .git-blame-ignore-revs

# cleanup lang package - mostly renaming variables
98abf5d7773df11c65d66e4e9485d0f1e3ef8821
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<!--- Describe your changes here. --->

---
**Target Minecraft Versions:** <!-- 'any' means all supported versions -->
**Requirements:** <!-- Required plugins, Minecraft versions, server software... -->
**Related Issues:** <!-- Links to related issues -->
**Target Minecraft Versions:** any <!-- 'any' means all supported versions -->
**Requirements:** none <!-- Required plugins, server software... -->
**Related Issues:** none <!-- Links to related issues -->
4 changes: 2 additions & 2 deletions .github/workflows/java-17-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Build Skript and run test scripts
run: ./gradlew clean skriptTestJava17
- name: Upload Nightly Build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success()
with:
name: skript-nightly
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-8-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Build Skript and run test scripts
run: ./gradlew clean skriptTestJava8
- name: Upload Nightly Build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success()
with:
name: skript-nightly
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/junit-17-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/junit-8-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
- name: Push release documentation
uses: ./skript/.github/workflows/docs/push-docs
with:
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
git_name: Release Docs Bot
git_email: [email protected]
Expand Down Expand Up @@ -69,6 +68,7 @@ jobs:
uses: ./skript/.github/workflows/docs/generate-docs
with:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
is_release: true
- name: Push archive documentation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
with:
submodules: recursive
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,6 @@ gradle-app.setting
# TODO remove this in the future after some time since https://github.com/SkriptLang/Skript/pull/4979
# This ensures developers don't upload their old existing test_runners/ folder.
test_runners/

## Mac MetaData
**/.DS_Store
58 changes: 29 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ allprojects {
dependencies {
shadow group: 'io.papermc', name: 'paperlib', version: '1.0.8'
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.0.2'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.0'
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.1-R0.1-SNAPSHOT'
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.20.4-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'
implementation group: 'net.milkbowl.vault', name: 'Vault', version: '1.7.1', {
implementation group: 'net.milkbowl.vault', name: 'Vault', version: '1.7.3', {
exclude group: 'org.bstats', module: 'bstats-bukkit'
}

implementation fileTree(dir: 'lib', include: '*.jar')

testShadow group: 'junit', name: 'junit', version: '4.13.2'
testShadow group: 'org.easymock', name: 'easymock', version: '5.2.0'
testShadow group: 'org.easymock', name: 'easymock', version: '5.0.1'
}

task checkAliases {
Expand Down Expand Up @@ -150,7 +150,7 @@ license {
}

task releaseJavadoc(type: Javadoc) {
title = project.property('version')
title = project.name + ' ' + project.property('version')
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options.encoding = 'UTF-8'
Expand Down Expand Up @@ -186,7 +186,10 @@ enum Modifiers {
}

// Create a test task with given name, environments dir/file, dev mode and java version.
void createTestTask(String name, String desc, String environments, int javaVersion, Modifiers... modifiers) {
// -1 on the timeout means it'll be disabled.
void createTestTask(String name, String desc, String environments, int javaVersion, long timeout, Modifiers... modifiers) {
if (timeout == 0)
timeout = 300000 // 5 minutes
boolean junit = modifiers.contains(Modifiers.JUNIT)
boolean releaseDocs = modifiers.contains(Modifiers.GEN_RELEASE_DOCS)
boolean docs = modifiers.contains(Modifiers.GEN_NIGHTLY_DOCS) || releaseDocs
Expand Down Expand Up @@ -223,14 +226,15 @@ void createTestTask(String name, String desc, String environments, int javaVersi
main = 'ch.njol.skript.test.platform.PlatformMain'
args = [
'build/test_runners',
junit ? 'src/test/skript/tests/junit' : 'src/test/skript/tests',
junit ? 'src/test/skript/junit' : 'src/test/skript/tests',
'src/test/resources/runner_data',
environments,
modifiers.contains(Modifiers.DEV_MODE),
docs,
junit,
modifiers.contains(Modifiers.DEBUG),
project.findProperty('verbosity') ?: "null"
project.findProperty('verbosity') ?: "null",
timeout
]

// Do first is used when throwing exceptions.
Expand All @@ -246,7 +250,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
}
}

def latestEnv = 'java17/paper-1.20.1.json'
def latestEnv = 'java17/paper-1.20.4.json'
def latestJava = 17
def oldestJava = 8

Expand All @@ -265,21 +269,21 @@ compileTestJava.options.encoding = 'UTF-8'
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)
createTestTask('skriptTestJava17', 'Runs tests on all Java 17 environments.', environments + 'java17', latestJava)
createTestTask('skriptTestJava8', 'Runs tests on all Java 8 environments.', environments + 'java8', oldestJava)
createTestTask('skriptTestDev', 'Runs testing server and uses \'system.in\' for command input, stop server to finish.', environments + env, envJava, Modifiers.DEV_MODE, Modifiers.DEBUG)
createTestTask('skriptProfile', 'Starts the testing server with JProfiler support.', environments + latestEnv, latestJava, Modifiers.PROFILE)
createTestTask('genNightlyDocs', 'Generates the Skript documentation website html files.', environments + env, envJava, Modifiers.GEN_NIGHTLY_DOCS)
createTestTask('genReleaseDocs', 'Generates the Skript documentation website html files for a release.', environments + env, envJava, Modifiers.GEN_RELEASE_DOCS)
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('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
}

createTestTask('JUnitQuick', 'Runs JUnit tests on one environment being the latest supported Java and Minecraft.', environments + latestEnv, latestJava, Modifiers.JUNIT)
createTestTask('JUnitJava17', 'Runs JUnit tests on all Java 17 environments.', environments + 'java17', latestJava, Modifiers.JUNIT)
createTestTask('JUnitJava8', 'Runs JUnit tests on all Java 8 environments.', environments + 'java8', oldestJava, Modifiers.JUNIT)
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)
tasks.register('JUnit') {
description = 'Runs JUnit tests on all environments.'
dependsOn JUnitJava8, JUnitJava17
Expand All @@ -291,10 +295,8 @@ task githubResources(type: ProcessResources) {
include '**'
version = project.property('version')
def channel = 'stable'
if (version.contains('alpha'))
channel = 'alpha'
else if (version.contains('beta'))
channel = 'beta'
if (version.contains('pre'))
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
'today' : '' + LocalTime.now(),
Expand Down Expand Up @@ -326,10 +328,8 @@ task spigotResources(type: ProcessResources) {
include '**'
version = project.property('version')
def channel = 'stable'
if (version.contains('alpha'))
channel = 'alpha'
else if (version.contains('beta'))
channel = 'beta'
if (version.contains('pre'))
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
'today' : '' + LocalTime.now(),
Expand Down Expand Up @@ -365,7 +365,7 @@ task nightlyResources(type: ProcessResources) {
'version' : version,
'today' : '' + LocalTime.now(),
'release-flavor' : 'skriptlang-nightly', // SkriptLang build, automatically done by CI
'release-channel' : 'alpha', // No update checking, but these are VERY unstable
'release-channel' : 'prerelease', // No update checking, but these are VERY unstable
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No autoupdates for now
'release-source' : '',
'release-download': 'null'
Expand All @@ -389,7 +389,7 @@ task nightlyRelease(type: ShadowJar) {

javadoc {
dependsOn nightlyResources

source = sourceSets.main.allJava

exclude("ch/njol/skript/conditions/**")
Expand Down
4 changes: 3 additions & 1 deletion code-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ If we need to remove or alter contributed code due to a licensing issue we will
- Static constant fields should be named in `UPPER_SNAKE_CASE`
* Localised messages should be named in `lower_snake_case`
- And that is the only place where snake_case is acceptable
* Use prefixes only where their use has been already estabilished (such as `ExprSomeRandomThing`)
* Use prefixes only where their use has been already established (such as `ExprSomeRandomThing`)
- Otherwise, use postfixes where necessary
- Common occurrences include: Struct (Structure), Sec (Section), EffSec (EffectSection), Eff (Effect), Cond (Condition), Expr (Expression)
* Ensure variable/field names are descriptive. Avoid using shorthand names like `e`, or `c`.
- e.g. Event should be `event`, not `e`. `e` is ambiguous and could mean a number of things.

### Comments
* Prefer to comment *why* you're doing things instead of how you're doing them
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Ensure encoding is consistent across systems.
org.gradle.jvmargs=-Xmx1G -Dfile.encoding=UTF-8
org.gradle.parallel=true

groupid=ch.njol
name=skript
version=2.8.0-dev
version=2.8.4
jarName=Skript.jar
testEnv=java17/paper-1.20.1
testEnv=java17/paper-1.20.4
testEnvJavaVersion=17
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

rootProject.name = 'Skript'
2 changes: 1 addition & 1 deletion skript-aliases
Loading

0 comments on commit 73da21b

Please sign in to comment.