Skip to content

Commit 9e79296

Browse files
committed
add: plugin base; add: Bon2Task; add: GitHub actions and Jitpack configurations;
0 parents  commit 9e79296

File tree

19 files changed

+846
-0
lines changed

19 files changed

+846
-0
lines changed

.github/workflows/ci-test.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Run gradle tests
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up JDK 8
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: '8'
17+
distribution: 'temurin'
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
- name: Run all tests
21+
run: ./gradlew check

.gitignore

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
##############################
2+
# Source https://gist.github.com/dedunumax/54e82214715e35439227
3+
##############################
4+
5+
##############################
6+
## Java
7+
##############################
8+
.mtj.tmp/
9+
*.class
10+
*.jar
11+
*.war
12+
*.ear
13+
*.nar
14+
hs_err_pid*
15+
16+
##############################
17+
## Maven
18+
##############################
19+
target/
20+
pom.xml.tag
21+
pom.xml.releaseBackup
22+
pom.xml.versionsBackup
23+
pom.xml.next
24+
pom.xml.bak
25+
release.properties
26+
dependency-reduced-pom.xml
27+
buildNumber.properties
28+
.mvn/timing.properties
29+
.mvn/wrapper/maven-wrapper.jar
30+
31+
##############################
32+
## Gradle
33+
##############################
34+
bin/
35+
build/
36+
.gradle
37+
.gradletasknamecache
38+
gradle-app.setting
39+
!gradle-wrapper.jar
40+
41+
##############################
42+
## IntelliJ
43+
##############################
44+
out/
45+
.idea/
46+
.idea_modules/
47+
*.iml
48+
*.ipr
49+
*.iws
50+
51+
##############################
52+
## Eclipse
53+
##############################
54+
.settings/
55+
bin/
56+
tmp/
57+
.metadata
58+
.classpath
59+
.project
60+
*.tmp
61+
*.bak
62+
*.swp
63+
*~.nib
64+
local.properties
65+
.loadpath
66+
.factorypath
67+
68+
##############################
69+
## NetBeans
70+
##############################
71+
nbproject/private/
72+
build/
73+
nbbuild/
74+
dist/
75+
nbdist/
76+
nbactions.xml
77+
nb-configuration.xml
78+
79+
##############################
80+
## Visual Studio Code
81+
##############################
82+
.vscode/
83+
.code-workspace
84+
85+
##############################
86+
## OS X
87+
##############################
88+
.DS_Store
89+
90+
##############################
91+
## Project extra
92+
##############################
93+
run/
94+
eclipse/

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Bon2Task for use BON2 in Gradle.
13+
14+
[unreleased]: https://github.com/MJaroslav/MCInGameTester/compare/FIRSTCOMMITHASH...HEAD

LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2+
Version 2, October 2022
3+
4+
Copyright (C) 2022 Yaroslav Novitsky (MJaroslav) <rcr3211@gmail.com>
5+
6+
Everyone is permitted to copy and distribute verbatim or modified
7+
copies of this license document, and changing it is allowed as long
8+
as the name is changed.
9+
10+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12+
13+
0. You just DO WHAT THE FUCK YOU WANT TO.

build.gradle

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
plugins {
2+
id 'java'
3+
id 'java-gradle-plugin'
4+
id 'maven-publish'
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
maven {
10+
name 'forge'
11+
url 'https://maven.minecraftforge.net/'
12+
}
13+
maven {
14+
name 'jitpack'
15+
url 'https://jitpack.io'
16+
}
17+
}
18+
19+
group = 'com.github.mjaroslav.bon2gradle'
20+
version = '0.1.0'
21+
archivesBaseName = "Bon2Gradle"
22+
23+
java {
24+
withSourcesJar()
25+
}
26+
27+
sourceSets {
28+
functionalTest {
29+
}
30+
}
31+
32+
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)
33+
34+
tasks.register('functionalTest', Test) {
35+
group = 'verification'
36+
testClassesDirs = sourceSets.functionalTest.output.classesDirs
37+
classpath = sourceSets.functionalTest.runtimeClasspath
38+
useJUnitPlatform()
39+
}
40+
41+
gradlePlugin.testSourceSets(sourceSets.functionalTest)
42+
43+
tasks.named('check') {
44+
if (Boolean.parseBoolean(System.getenv("CI")))
45+
dependsOn(tasks.functionalTest)
46+
}
47+
48+
tasks.named('test') {
49+
useJUnitPlatform()
50+
}
51+
52+
configure([tasks.compileJava, tasks.compileTestJava, tasks.compileFunctionalTestJava]) {
53+
sourceCompatibility = 16 // for the IDE support
54+
options.release = 8
55+
javaCompiler = javaToolchains.compilerFor { languageVersion = JavaLanguageVersion.of(16) }
56+
}
57+
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
58+
59+
dependencies {
60+
compileOnly("com.anatawa12.forge:ForgeGradle:${project.forgegradle_version}") {
61+
changing = true
62+
}
63+
runtimeOnly("com.anatawa12.forge:ForgeGradle:${project.forgegradle_version}") {
64+
changing = true
65+
}
66+
implementation "com.github.FIXxp:BON2:${project.bon2_version}:bin"
67+
testImplementation("com.anatawa12.forge:ForgeGradle:${project.forgegradle_version}") {
68+
changing = true
69+
}
70+
testImplementation "org.junit.jupiter:junit-jupiter:${project.junit_version}"
71+
72+
compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
73+
testCompileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
74+
functionalTestCompileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
75+
compileOnly "org.projectlombok:lombok:${project.lombok_version}"
76+
annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
77+
testCompileOnly "org.projectlombok:lombok:${project.lombok_version}"
78+
testAnnotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
79+
functionalTestCompileOnly "org.projectlombok:lombok:${project.lombok_version}"
80+
functionalTestAnnotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
81+
annotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${project.jabel_version}"
82+
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${project.jabel_version}"
83+
functionalTestAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${project.jabel_version}"
84+
}
85+
86+
gradlePlugin {
87+
plugins {
88+
bon2gradle {
89+
id = 'bon2gradle'
90+
implementationClass = 'com.github.mjaroslav.bon2gradle.Bon2GradlePlugin'
91+
}
92+
}
93+
}
94+
95+
publishing {
96+
publications {
97+
mavenJava(MavenPublication) {
98+
artifact jar
99+
artifact sourcesJar
100+
}
101+
}
102+
}

gradle.properties

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
forgegradle_version=1.2-1.0.+
2+
bon2_version=master-SNAPSHOT
3+
junit_version=5.8.2
4+
lombok_version=1.18.22
5+
jetbrains_annotations_version=23.0.0
6+
jabel_version=0.4.1

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)