Skip to content
Permalink
Browse files

updated build script, added travis script

  • Loading branch information...
ShchAlexander committed Feb 25, 2019
1 parent 8a3c628 commit 6fdafd9ef89b02c8792604d8788856376702c2d0
@@ -0,0 +1,29 @@
language: java
sudo: false
install: true

jdk:
- oraclejdk8

addons:
sonarcloud: true

stages:
- name: build
if: type = push
- name: build_pull_request
if: (type = pull_request) AND (branch = develop)

jobs:
include:
- stage: build
script: ./gradlew clean build test sonarqube -Dsonar.login=$SONAR_LOGIN
- stage: build_pull_request
script: ./gradlew clean build test sonarqube -Dsonar.login=$SONAR_LOGIN -Dsonar.pullrequest.base=$TRAVIS_BRANCH -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=SpinyOwl/SpinyGUI

cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/.gradle'
- '.gradle'
@@ -9,7 +9,7 @@ dependencies {

compile group: 'org.apache.commons', name: 'commons-lang3', version: commons_version, changing: false

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: junit_version
}

ext.moduleName = 'com.spinyowl.spinygui.backend.core'
@@ -2,15 +2,13 @@ plugins {
id 'java-library'
}

def lwjgl_version = '3.2.1-SNAPSHOT'

dependencies {
api project(':core')
api project(':backend.core')
api project(':backend.glfwutil')

// https://mvnrepository.com/artifact/com.google.guava/guava-collections
compile group: 'com.google.guava', name: 'guava-collections', version: 'r03'
compile group: 'com.google.guava', name: 'guava-collections', version: guava_collections_version

compile group: 'org.lwjgl', name: 'lwjgl', version: lwjgl_version
compile group: 'org.lwjgl', name: 'lwjgl', version: lwjgl_version, changing: true, classifier: 'natives-windows'
@@ -27,7 +25,7 @@ dependencies {
compile group: 'org.lwjgl', name: 'lwjgl-glfw', version: lwjgl_version, changing: true, classifier: 'natives-linux'
compile group: 'org.lwjgl', name: 'lwjgl-glfw', version: lwjgl_version, changing: true, classifier: 'natives-macos'

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: junit_version
}

ext.moduleName = 'com.spinyowl.spinygui.backend.opengl32'
@@ -2,16 +2,23 @@ plugins {
id "org.sonarqube" version "2.7"
}

group 'com.spinyowl'
version '0.0.1-SNAPSHOT'

project.group = 'com.spinyowl'

println "##################################################"
println "# Project info: #"
println sprintf("# group: %-33s#", project.group)
println sprintf("# name: %-33s#", project.name)
println sprintf("# version: %-33s#", project.version)
println "##################################################"

subprojects {

buildDir = new File(rootProject.projectDir, "build/" + project.name)

afterEvaluate {
group 'com.spinyowl'
version rootProject.version
group = 'com.spinyowl'
version = rootProject.version

repositories {
mavenCentral()
@@ -22,11 +29,6 @@ subprojects {

}

dependencies {// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
// compile group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta2'
// compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.8.0-beta2'
}

sourceCompatibility = 1.11

compileJava {
@@ -3,20 +3,22 @@ plugins {
}

dependencies {
compile group: 'io.github.classgraph', name: 'classgraph', version: '4.0.6'
// https://mvnrepository.com/artifact/io.github.classgraph/classgraph
compile group: 'io.github.classgraph', name: 'classgraph', version: classgraph_version

// https://mvnrepository.com/artifact/org.jdom/jdom2
compile group: 'org.jdom', name: 'jdom2', version: '2.0.6'
compile group: 'org.jdom', name: 'jdom2', version: jdom_version

// https://mvnrepository.com/artifact/com.google.guava/guava-collections
compile group: 'com.google.guava', name: 'guava-collections', version: 'r03'
compile group: 'com.google.guava', name: 'guava-collections', version: guava_collections_version

// https://mvnrepository.com/artifact/org.antlr/antlr4-runtime
compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.7.1'
compile group: 'org.antlr', name: 'antlr4-runtime', version: antlr4_version

// https://mvnrepository.com/artifact/org.joml/joml
compile group: 'org.joml', name: 'joml', version: '1.9.12'
compile group: 'org.joml', name: 'joml', version: joml_version

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: junit_version
}

ext.moduleName = 'com.spinyowl.spinygui.core'
@@ -2,7 +2,7 @@

import com.spinyowl.spinygui.core.api.Window;

public class WindowEvent extends Event<Window> {
public abstract class WindowEvent extends Event<Window> {

public WindowEvent(Window target) {
super(target);
@@ -60,38 +60,47 @@ public static RendererFactoryService getRendererFactoryService() {
// get all subclasses
String serviceClassName = serviceClass.getName();

List<Class<?>> spinyguiClassRefs;
List<Class<?>> serviceClassRefs;
if (serviceClass.isInterface()) {
spinyguiClassRefs = scanResult.getClassesImplementing(serviceClassName).loadClasses();
serviceClassRefs = scanResult.getClassesImplementing(serviceClassName).loadClasses();
} else {
spinyguiClassRefs = scanResult.getSubclasses(serviceClassName).loadClasses();
serviceClassRefs = scanResult.getSubclasses(serviceClassName).loadClasses();
}
// check if found implementations.
if (spinyguiClassRefs != null && !spinyguiClassRefs.isEmpty()) {
if (serviceClassRefs != null && !serviceClassRefs.isEmpty()) {
// log existing implementations
if (LOGGER.isLoggable(Level.INFO)) {
for (Class<?> classRef : spinyguiClassRefs) {
LOGGER.log(Level.INFO,String.format("%s class implementation found: %s", serviceClass.getSimpleName(), classRef.getName()));
for (Class<?> classRef : serviceClassRefs) {
LOGGER.log(Level.INFO, String.format("%s class implementation found: %s", serviceClass.getSimpleName(), classRef.getName()));
}
}

//get property

if (implementationClass != null) {
LOGGER.log(Level.INFO,"Trying to load specified implementation: '" + implementationClass + "'.");
for (Class<?> aClass : spinyguiClassRefs) {
LOGGER.log(Level.INFO, "Trying to load specified implementation: '" + implementationClass + "'.");
for (Class<?> aClass : serviceClassRefs) {
if (implementationClass.equals(aClass.getName()) || implementationClass.equals(aClass.getSimpleName())) {
instance = createInstance((Class<T>) aClass);
}
}

if (instance == null) {
LOGGER.log(Level.INFO,"Specified implementation '" + implementationClass + "' not found.");
LOGGER.log(Level.INFO, "Specified implementation '" + implementationClass + "' not found.");
} else {
LOGGER.log(Level.INFO,"Specified implementation '" + implementationClass + "' loaded.");
LOGGER.log(Level.INFO, "Specified implementation '" + implementationClass + "' loaded.");
}
} else {
instance = createInstance((Class<T>) spinyguiClassRefs.get(0));
instance = createInstance((Class<T>) serviceClassRefs.get(0));
}
} else {
try {
Class<?> aClass = Class.forName(implementationClass);
if (serviceClass.isAssignableFrom(aClass)) {
instance = createInstance((Class<T>) aClass);
}
} catch (ClassNotFoundException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
}
}
@@ -103,7 +112,7 @@ public static RendererFactoryService getRendererFactoryService() {
try {
instance = clazz.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
LOGGER.log(Level.WARNING,e.getMessage(), e);
LOGGER.log(Level.WARNING, e.getMessage(), e);
}
return instance;
}
@@ -7,7 +7,7 @@
requires guava.collections.r03;
requires io.github.classgraph;
requires transitive java.logging;
requires antlr4.runtime;
requires org.antlr.antlr4.runtime;

exports com.spinyowl.spinygui.core.animation;
exports com.spinyowl.spinygui.core.api;
@@ -5,8 +5,6 @@ plugins {
id 'application'
}

def lwjgl_version = '3.2.1-SNAPSHOT'

dependencies {
compile group: 'org.lwjgl', name: 'lwjgl', version: lwjgl_version, changing: true
compile group: 'org.lwjgl', name: 'lwjgl', version: lwjgl_version, changing: true, classifier: 'natives-windows'
@@ -28,7 +26,7 @@ dependencies {
implementation project(':backend.glfwutil')
implementation project(':backend.opengl32')

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: junit_version
}

ext.moduleName = 'com.spinyowl.spinygui.demo.integrated'
@@ -8,7 +8,7 @@ plugins {
dependencies {
implementation project(':spinygui')

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: junit_version
}

ext.moduleName = 'com.spinyowl.spinygui.demo'
@@ -1 +1,9 @@
lwjgl_version=3.2.1-SNAPSHOT
version=0.0.1-SNAPSHOT

lwjgl_version=3.2.2-SNAPSHOT
classgraph_version=4.8.7
jdom_version=2.0.6
guava_collections_version=r03
antlr4_version=4.7.2
joml_version=1.9.13
junit_version=4.12

0 comments on commit 6fdafd9

Please sign in to comment.
You can’t perform that action at this time.