Skip to content

Commit

Permalink
Merge pull request #53 from buschmais/sarf-modularization
Browse files Browse the repository at this point in the history
Sarf modularization
  • Loading branch information
StephanPirnbaum authored Jul 26, 2019
2 parents b5de02e + 490acee commit b20600d
Show file tree
Hide file tree
Showing 117 changed files with 503 additions and 549 deletions.
158 changes: 17 additions & 141 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,158 +3,42 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>sar-framework-cli</module>
<module>sar-framework-app</module>
<module>sar-framework-core</module>
<module>sar-framework-benchmark</module>
</modules>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<version>2.1.6.RELEASE</version>
</parent>

<groupId>com.buschmais.sarf</groupId>
<artifactId>sar-framework</artifactId>
<version>0.4.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.0.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
<com.buschmais.jqassistant_version>1.6.0</com.buschmais.jqassistant_version>
<com.buschmais.xo_version>0.11.0</com.buschmais.xo_version>
<org.hibernate-validator_version>5.2.1.Final</org.hibernate-validator_version>
<com.fasterxml.jackson.version>2.9.7</com.fasterxml.jackson.version>
<jenetics.version>4.4.0</jenetics.version>
<guava.version>22.0</guava.version>
</properties>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

<dependency>
<!-- For using an embedded Neo4j instance -->
<groupId>com.buschmais.xo</groupId>
<artifactId>xo.neo4j.embedded</artifactId>
</dependency>
<dependency>
<!-- The XO API -->
<groupId>com.buschmais.xo</groupId>
<artifactId>xo.api</artifactId>
</dependency>
<dependency>
<!-- The XO runtime implementation -->
<groupId>com.buschmais.xo</groupId>
<artifactId>xo.impl</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<!-- jQAssistant reports -->
<groupId>com.buschmais.jqassistant.core</groupId>
<artifactId>report</artifactId>
</dependency>
<dependency>
<!-- jQAssistant store connection -->
<groupId>com.buschmais.jqassistant.core</groupId>
<artifactId>store</artifactId>
</dependency>
<dependency>
<!-- jQAssistant Java plugin -->
<groupId>com.buschmais.jqassistant.plugin</groupId>
<artifactId>java</artifactId>
</dependency>

<dependency>
<!-- JSON and XML object mapper -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<!-- Method Generator -->
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>io.jenetics</groupId>
<artifactId>jenetics</artifactId>
</dependency>
<dependency>
<groupId>io.jenetics</groupId>
<artifactId>jenetics.ext</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/net.mikera/vectorz -->
<dependency>
<groupId>net.mikera</groupId>
<artifactId>vectorz</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
</dependency>

<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
</dependency>

</dependencies>

<dependencyManagement>
<dependencies>
<!-- sarf -->
<dependency>
<groupId>com.buschmais.sarf</groupId>
<artifactId>sar-framework-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<!-- For using an embedded Neo4j instance -->
<groupId>com.buschmais.xo</groupId>
Expand Down Expand Up @@ -221,7 +105,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>io.jenetics</groupId>
Expand All @@ -246,14 +130,6 @@
<version>0.65.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
51 changes: 51 additions & 0 deletions sar-framework-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sar-framework</artifactId>
<groupId>com.buschmais.sarf</groupId>
<version>0.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>sar-framework-app</artifactId>

<dependencies>
<dependency>
<groupId>com.buschmais.sarf</groupId>
<artifactId>sar-framework-core</artifactId>
</dependency>

<dependency>
<groupId>com.buschmais.xo</groupId>
<artifactId>xo.neo4j.embedded</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.6.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.buschmais.sarf.framework.ui;
package com.buschmais.sarf.app.ui;

import javafx.scene.control.Alert;
import javafx.scene.control.Label;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.buschmais.sarf.framework.ui;
package com.buschmais.sarf.app.ui;

import com.buschmais.sarf.framework.ClassificationRunner;
import com.buschmais.sarf.framework.configuration.ClassificationConfigurationXmlMapper;
import com.buschmais.sarf.framework.configuration.Decomposition;
import com.buschmais.sarf.framework.configuration.Optimization;
import com.buschmais.sarf.core.framework.ClassificationRunner;
import com.buschmais.sarf.core.framework.configuration.ClassificationConfigurationXmlMapper;
import com.buschmais.sarf.core.framework.configuration.Decomposition;
import com.buschmais.sarf.core.framework.configuration.Optimization;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.buschmais.sarf.framework.ui;
package com.buschmais.sarf.app.ui;

import com.buschmais.xo.api.XOManager;
import javafx.fxml.FXML;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.buschmais.sarf.framework.ui;
package com.buschmais.sarf.app.ui;

import org.springframework.stereotype.Controller;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane fx:id="configPane" maxWidth="426.0" minWidth="426.0" prefHeight="183.0" prefWidth="426.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.framework.ui.ConfigurationDialogController">
<AnchorPane fx:id="configPane" maxWidth="426.0" minWidth="426.0" prefHeight="183.0" prefWidth="426.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.app.ui.ConfigurationDialogController">
<children>
<VBox prefHeight="189.0" prefWidth="470.0" spacing="10.0">
<children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane maxWidth="426.0" minWidth="426.0" prefHeight="79.0" prefWidth="426.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.framework.ui.DatabaseConnectionController">
<AnchorPane maxWidth="426.0" minWidth="426.0" prefHeight="79.0" prefWidth="426.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.app.ui.DatabaseConnectionController">
<children>
<VBox prefHeight="63.0" prefWidth="440.0" spacing="10.0">
<children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<BorderPane fx:id="pane" maxHeight="-Infinity" maxWidth="430.0" minHeight="-Infinity" minWidth="430.0" prefHeight="315.0" prefWidth="430.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.framework.ui.RootController">
<BorderPane fx:id="pane" maxHeight="-Infinity" maxWidth="430.0" minHeight="-Infinity" minWidth="430.0" prefHeight="315.0" prefWidth="430.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.buschmais.sarf.app.ui.RootController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
Expand Down
21 changes: 21 additions & 0 deletions sar-framework-benchmark/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sar-framework</artifactId>
<groupId>com.buschmais.sarf</groupId>
<version>0.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>sar-framework-benchmark</artifactId>

<dependencies>
<dependency>
<groupId>com.buschmais.sarf</groupId>
<artifactId>sar-framework-core</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
/**
* @author Stephan Pirnbaum
*/
public class BenchmarkRunner {
public class BenchmarkApplication {

public static void main(String[] args) throws URISyntaxException {
/*DatabaseHelper.setUpDB(new URI("file:///E:/Development/trainingszeitverwaltung-kraftraum/target/jqassistant/store"));
LongChromosome chromosome = LongChromosome.of(0, 3, 13);
Genotype<LongGene> genotype = Genotype.of(chromosome);
Engine<LongGene, Double> engine = Engine
.builder(BenchmarkRunner::computeFitnessValue, genotype)
.builder(BenchmarkApplication::computeFitnessValue, genotype)
.fitnessScaler(f -> Math.pow(f, 2))
.maximizing()
.offspringSelector(new RouletteWheelSelector<>())
Expand All @@ -32,7 +32,7 @@ public static void main(String[] args) throws URISyntaxException {
engine
.stream()
.limit(50)
.peek(BenchmarkRunner::peek)
.peek(BenchmarkApplication::peek)
.collect(EvolutionResult.toBestGenotype());*/
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package com.buschmais.sarf.framework;
package com.buschmais.sarf.benchmark;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.net.URL;

@Service
@Lazy
@Slf4j
public class BenchmarkRunner implements AbstractRunner {
public class BenchmarkRunner {

@Override
public Double run(URL configUrl) {
LOGGER.error("Benchmark functionality currently not available");
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.buschmais.sarf.benchmark;

import com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor;
import com.buschmais.sarf.framework.metamodel.ComponentDescriptor;
import com.buschmais.sarf.core.framework.metamodel.ComponentDescriptor;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.buschmais.sarf.benchmark;

import com.buschmais.sarf.plugin.cohesion.evolution.Problem;
import com.buschmais.sarf.plugin.cohesion.evolution.similarity.SimilarityProblem;
import com.buschmais.sarf.core.plugin.cohesion.evolution.Problem;
import com.buschmais.sarf.core.plugin.cohesion.evolution.similarity.SimilarityProblem;

import java.util.Map;
import java.util.Objects;
Expand Down
Loading

0 comments on commit b20600d

Please sign in to comment.