This commit is contained in:
raoulvdberge
2020-10-18 22:11:27 +02:00
parent a0be8c53c6
commit 9d48419403
5 changed files with 33 additions and 1 deletions

5
Jenkinsfile vendored
View File

@@ -9,6 +9,9 @@ node {
stage('Cleanup') { stage('Cleanup') {
sh "./gradlew clean" sh "./gradlew clean"
} }
stage('Test') {
sh "./gradlew test"
}
stage('Build') { stage('Build') {
sh "./gradlew build" sh "./gradlew build"
} }
@@ -19,7 +22,7 @@ node {
stage('Publish artifacts') { stage('Publish artifacts') {
sh "./gradlew publish" sh "./gradlew publish"
} }
stage('SonarQube') { stage('SonarQube analysis') {
withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) { withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) {
sh "./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN" sh "./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN"
} }

View File

@@ -11,6 +11,7 @@ buildscript {
plugins { plugins {
id "org.sonarqube" version "3.0" id "org.sonarqube" version "3.0"
id 'info.solidsoft.pitest' version '1.5.1'
} }
repositories { repositories {
@@ -33,6 +34,11 @@ sonarqube {
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'info.solidsoft.pitest'
pitest {
junit5PluginVersion = "0.12"
}
version = '1.9.8' version = '1.9.8'
def env = System.getenv() def env = System.getenv()
@@ -118,6 +124,10 @@ dependencies {
compileOnly 'mouse-tweaks:MouseTweaks:2.13:mc1.16.2' compileOnly 'mouse-tweaks:MouseTweaks:2.13:mc1.16.2'
runtimeOnly fg.deobf('crafting-tweaks:CraftingTweaks_1.16.2:12.1.0') runtimeOnly fg.deobf('crafting-tweaks:CraftingTweaks_1.16.2:12.1.0')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.6.2')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.6.2')
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.16.1'
} }
jar { jar {
@@ -160,6 +170,10 @@ artifacts {
archives apiJar archives apiJar
} }
test {
useJUnitPlatform()
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {

View File

@@ -123,4 +123,9 @@ public interface IStackList<T> {
*/ */
@Nonnull @Nonnull
IStackList<T> copy(); IStackList<T> copy();
/**
* @return the amount of elements in this list
*/
int size();
} }

View File

@@ -157,4 +157,9 @@ public class FluidStackList implements IStackList<FluidStack> {
return list; return list;
} }
@Override
public int size() {
return stacks.size();
}
} }

View File

@@ -155,4 +155,9 @@ public class ItemStackList implements IStackList<ItemStack> {
return list; return list;
} }
@Override
public int size() {
return stacks.size();
}
} }