Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • db2-praktikum/base-project
  • s.ruehl/base-project
  • istasseit/base-project
  • istthweig/base-project
  • istmebici/base-project
5 results
Select Git revision
Show changes
Commits on Source (38)
Showing
with 740 additions and 973 deletions
image: openjdk:alpine
image: registry.code.fbi.h-da.de/db2-praktikum/base-project/dependency_image:latest
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew
- cp -r /dependencies/.gradle ./
- cp -r /dependencies/build ./
stages:
- create_dependency_image
- build
- check
......@@ -17,39 +19,57 @@ build:
checkstyle_main:
stage: check
script:
- ./gradlew check checkstyleMain -x test
- ./gradlew checkstyleMain -x test
- cp build/reports/checkstyle/main.html ./checkstyleMain.html
artifacts:
paths:
- checkstyleMain.html
- checkstyleMain.html
expire_in: 1 week
checkstyle_test:
stage: check
script:
- ./gradlew check checkstyleTest -x test
- ./gradlew checkstyleTest -x test
- cp build/reports/checkstyle/test.html ./checkstyleTest.html
artifacts:
paths:
- checkstyleTest.html
- checkstyleTest.html
expire_in: 1 week
spotbugs_main:
stage: check
script:
- ./gradlew check spotbugsMain -x test
- ./gradlew spotbugsMain -x test
- cp build/reports/spotbugs/main.html ./spotbugsMain.html
artifacts:
paths:
- spotbugsMain.html
- spotbugsMain.html
expire_in: 1 week
spotbugs_test:
stage: check
script:
- ./gradlew check spotbugsTest -x test
- ./gradlew spotbugsTest -x test
- cp build/reports/spotbugs/test.html ./spotbugsTest.html
artifacts:
paths:
- spotbugsTest.html
- spotbugsTest.html
expire_in: 1 week
test:
stage: check
script:
- ./gradlew test -Dci-server=true
# create_dependency_image:
# stage: create_dependency_image
# image:
# name: gcr.io/kaniko-project/executor:debug
# entrypoint: [""]
# script:
# - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/dependencyImage/Dockerfile --destination $CI_REGISTRY_IMAGE/dependency_image:latest
# when: manual
# only:
# - dependencyImage
\ No newline at end of file
# Wissenstest (Praktikum zur Lehrveranstaltung Datenbanken 2)
Diese Repository bildet die Grundlage für Ihr Praktikum in Datenbanken 2. Sie werden auf seiner Basis über das gesamte Semester verteilt in mehreren Schritten ein Wissensquiz entwickeln.
Zu diesem Zweck werden wir Git und GitLab einsetzten. Sollten Sie mehr informationen und Hilfe zu den beiden Tools benötigen, klicken Sie bitte [hier](readme/gitandgitlab.md).
Dieses Repository bildet die Grundlage für Ihr Praktikum in Datenbanken 2. Sie werden auf seiner Basis über das gesamte Semester verteilt in mehreren Schritten ein Wissensquiz entwickeln.
Zu diesem Zweck werden wir Git und GitLab einsetzten. Sollten Sie mehr Informationen und Hilfe zu den beiden Tools benötigen, klicken Sie bitte [hier](readme/gitandgitlab.md).
in diesem Dokument finden Sie die folgenden Informationen:
In diesem Dokument finden Sie die folgenden Informationen:
- [Fachliche Projektbeschreibung](#fachliche-projectbeschreibung)
- [Fachliche Projektbeschreibung](#fachliche-projektbeschreibung)
- [Technische Projektbeschreibung](#technische-projektbeschreibung)
- [Hinweis zur Autorenschaft](#hinweis-zur-autorenschaft)
Hier finden Sie nun eine fachliche Projektbeschreibung des zu Implementierende Spiels
Hier finden Sie nun eine fachliche Projektbeschreibung des zu Implementierenden Spiels
# Fachliche Projektbeschreibung
......@@ -24,7 +24,7 @@ Zu jeder Frage gibt es genau vier Antworten, von denen genau eine richtig ist un
Jede Frage gehört zu genau einer Kategorie.
Eine Basis von Kategorien, Fragen und Antworten als Stammdaten wird in einer entsprechenden `csv`-Datei zur Verfügung gestellt. Die `csv`-Datei finden Sie im Unterordner `/src/main/resources/`. Sie trägt den Namen: `Wissenstest_sample200.csv`.
Eine Basis von Kategorien, Fragen und Antworten als Stammdaten wird in einer entsprechenden `csv`-Datei zur Verfügung gestellt. Die `csv`-Datei finden Sie im Unterordner `/src/main/resources/`. Sie trägt den Namen: `Wissenstest_sample200.csv`. Hier kann sie direkt gefunden werden: [Link](/src/main/resources/Wissenstest_sample200.csv)
## Spielbeschreibung
......@@ -48,52 +48,52 @@ Haben mehrere Spieler das Spiel gespielt, so gibt es die Möglichkeit, Analysen
## Projektrahmen
Im diesem Repository finden Sie einen Projektrahmen, den Sie für die Implementierung des gesamten Projektes verwenden sollen. Unter anderem bringt er eine Package-Struktur mit, in die Sie Ihren Code einfügen sollen. Konkret heißt dies, dass alle von Ihnen erzeugten Klassen in `de.hda.fbi.db2.stud` oder von ihnen erstellte Unterordner in dem Package zu erstellen sind.
In diesem Repository finden Sie einen Projektrahmen, den Sie für die Implementierung des gesamten Projektes verwenden sollen. Unter anderem bringt er eine Package-Struktur mit, in die Sie Ihren Code einfügen sollen. Konkret heißt dies, dass alle von Ihnen erzeugten Klassen in `de.hda.fbi.db2.stud` oder von ihnen erstellte Unterordner in dem Package zu erstellen sind.
Viele Teile des eigentlichen Wissenstests als Spiel sind bereits vorgegeben, beziehungsweise implementiert. Schauen Sie sich die abstrakten Klassen in dem Package `de.hda.fbi.db2.api` an. Ihre Aufgabe besteht darin für jedes Praktikum eine Implementierung (Unterklasse) für diese zur Verfügung zu stellen. Ihre Implementierung muss innerhalb oder unterhalb des Packages `de.hda.fbi.db2.stud` sein. Lesen Sie sich genaustens die JavaDoc Kommentare in den abstrakten Klassen durch.
In der Klasse `Main`, müssen Sie für jeweilige Praktika gegebenenfalls Codezeilen aus- beziehungsweise einkommentieren.
Darüber hinaus, bringt der Projektrahmen noch die folgenden Dinge mit:
- Gradle Projekt: fertiges Projekt, damit Sie direkt mit der Entwicklung anfangen können. Weitere Informationen zu Gradle finden Sie [hier](https://gradle.org/)
- Vorbereitete JPA Ressourcen (z.B. `persistance.xml`)
- Gradle Projekt: Fertiges Projekt, damit Sie direkt mit der Entwicklung anfangen können. Weitere Informationen zu Gradle finden Sie [hier](https://gradle.org/)
- Vorbereitete JPA Ressourcen (z.B. `persistence.xml`)
- Datenbasis als `csv`-Datei. Die Datei finden Sie im Unterordner `/src/main/resources/Wissenstest_sample200.csv`
- Parser für die Datenbasis. Sie finden diesen im Package: `de.hda.fbi.db2.controller.CsvDataReader`
- Parser für die Datenbasis. Der Klassenname ist: `de.hda.fbi.db2.controller.CsvDataReader`
- CI/CD Pipeline (details siehe unten) zum Bauen und Testen Ihres Projektes auf dem GitLab Server
Weiter Hinweise wie sie das Projekt bei sich Lokal clonen und in IntelliJ verwenden finden sie [hier](readme/gitandgitlab.md)
Weitere Hinweise wie sie das Projekt bei sich Lokal clonen und in IntelliJ verwenden finden sie [hier](readme/gitandgitlab.md)
## Benötigte Software für die Arbeit mit Git bzw. GitLab
Sie benötigen für dieses Praktikum die [IDE IntelliJ](https://www.jetbrains.com/idea/) IDE mit [Gradle-Plugin](https://docs.gradle.org/current/userguide/idea_plugin.html) (automatisch Teil von IntelliJ) und JDK8
Sie benötigen für dieses Praktikum die [IDE IntelliJ](https://www.jetbrains.com/idea/) mit [Gradle-Plugin](https://docs.gradle.org/current/userguide/idea_plugin.html) (automatisch Teil von IntelliJ) und JDK11
- Für IntelliJ ist **vorab** eine kostenlose Registrierung als Student notwendig.
- Andere IDEs sind möglich, werden im Praktikum aber nicht unterstützt.
Wir empfehlen, zusätzlich zum in IntelliJ integrierten Git-Client die Software TortoiseGIT zu installieren:
- Unter Windows: [TortoiseGIT](https://tortoisegit.org/) integriert sich in den Windows-Explorer, sodass alle Funktionen im Explorer über das Kontextmenü (rechte Maustaste) aufrufbar sind. Zur Nutzung von TortoiseGIT benötigen Sie außerdem GitForWindows.
- Unter Windows: [TortoiseGIT](https://tortoisegit.org/) integriert sich in den Windows-Explorer, sodass alle Funktionen im Explorer über das Kontextmenü (rechte Maustaste) aufrufbar sind. Zur Nutzung von TortoiseGIT benötigen Sie außerdem [GitForWindows](https://gitforwindows.org/).
- Falls Sie Linux verwenden, installieren Sie ein git package Ihrer Wahl. Aber, ganz ehrlich, wenn Sie Linux verwenden, wissen Sie genau was zu tun ist.
## Continuous Integration Pipeline
Der GitLab Server führt automatisch Builds und Tests Ihrer Commits durch. Damit können Sie und wir schon im Vorfeld prüfen, ob Ihr aktueller Stand den Anforderungen entspricht.
Der GitLab-Server führt automatisch Builds und Tests Ihrer Commits durch. Damit können Sie und wir schon im Vorfeld prüfen, ob Ihr aktueller Stand den Anforderungen entspricht. Die existierenden Unit-Tests werden automatisch übersprungen wenn Sie die entsprechende Praktikumsaufgabe noch nicht implementiert haben.
Wie oben beschrieben, setzen wir dabei voraus, dass Sie Ihr Projekt in dem von uns vorgesehenem Package entwickeln: `de.hda.fbi.db2.stud`. Wenn Sie sich nicht an diese Anforderung halten, erhalten Sie kein Testat! Den Stand Ihrer Builds und Tests können Sie links in Ihrem Repository über das Menu "CI/CD" → "Pipelines" abrufen.
Die Pipeline verwendet die folgenden zwei Tools:
- [Checkstyle](http://checkstyle.sourceforge.net/) ist ein Werkzeug zur statischen Code-Analyse zur Prüfung des Programmierstils von Java-Sourcecode. Konkret verwenden wir im Praktikum Google's Java Code Style. Eine Beschreibung können Sie [hier](https://google.github.io/styleguide/javaguide.html) bzw. [hier](http://checkstyle.sourceforge.net/google_style.html) finden.
- [Checkstyle](https://checkstyle.sourceforge.io/) ist ein Werkzeug zur statischen Code-Analyse zur Prüfung des Programmierstils von Java-Sourcecode. Konkret verwenden wir im Praktikum Google's Java Code Style. Eine Beschreibung können Sie [hier](https://google.github.io/styleguide/javaguide.html) bzw. [hier](https://checkstyle.sourceforge.io/google_style.html) finden.
- [Spotbugs](https://spotbugs.github.io/) such in Java-Programmen nach Fehlermustern. Solche Fehlermuster deuten oft auf tatsächliche Fehler hin.
## Nutzen der Checkstyle und Spotbugs in IntelliJ
Bevor Sie ihren Code zum GitLab Server pushen, sollten Sie local mit Hilfe von Spotbugs und Checkstyle überprüfen lassen ob die Pipeline Fehler finden wird. Dafür rufen Sie einfach in IntelliJ den Gradle task `build` auf. In der Konsolenausgabe werden entsprechende Fehler angezeigt.
Bevor Sie ihren Code zum GitLab-Server pushen, sollten Sie local mit Hilfe von Spotbugs und Checkstyle überprüfen lassen, ob die Pipeline Fehler finden wird. Dafür rufen Sie einfach in IntelliJ den Gradle task `build` auf. In der Konsolenausgabe werden entsprechende Fehler angezeigt.
Erzeugte Reports finden Sie local im Projekt unter `/build/reports/`.
Erzeugte Reports finden Sie lokal im Projekt unter `/build/reports/`.
## Konfiguration von IntelliJ zur Verwendung des Google Style Checker
IntelliJ verwendet standardmäßig im Editor für Style Checking **nicht** Google's Java Code Style. Dies sollten Sie manuell konfigurieren. Sie tun dies indem Sie die Einstellungen von IntelliJ öffnen (File → Settings → Editor → Code Style) und wählen bei Import Schema (siehe Screenshot)
IntelliJ verwendet standardmäßig im Editor für Style Checking **nicht** Google's Java Code Style. Dies sollten Sie manuell konfigurieren. Sie tun dies, indem Sie die Einstellungen von IntelliJ öffnen (File → Settings → Editor → Code Style) und wählen bei Import Schema (siehe Screenshot)
Sie finden die nötige Datei im Projektordner unter: `/readme/intellij-java-google-style.xml`
![IntelliJ Änderung Coding Style](readme/intellij-googlestyleplugin.png)
......
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.7/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
......@@ -13,89 +5,112 @@ plugins {
// Apply the application plugin to add support for building an application
id 'application'
id 'com.github.spotbugs' version "2.0.0"
id 'com.github.spotbugs' version '4.7.9'
id 'checkstyle'
id "de.undercouch.download" version "4.0.0"
id 'groovy'
// Used by 'downloadTests' task below
id 'de.undercouch.download' version '4.1.2'
}
// Define the main class for the application
mainClassName = 'de.hda.fbi.db2.Main'
application {
// Define the main class for the application
mainClass.set('de.hda.fbi.db2.Main')
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
spotbugs {
ignoreFailures = false
// Only cause failure for high priority issues
// Note: Currently this excludes all lower priority issues from report, see
// https://github.com/spotbugs/spotbugs-gradle-plugin/issues/14
reportLevel = 'high'
showStackTraces = false
}
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
xml.required = false
html.required = true
}
}
checkstyle {
toolVersion "7.6.1"
//configFile file("config/checkstyle/wso2_checks.xml")
//configFile file("config/checkstyle/sun_checks.xml")
configFile file("config/checkstyle/google_checks.xml")
toolVersion '8.29'
//configFile file('config/checkstyle/wso2_checks.xml')
//configFile file('config/checkstyle/sun_checks.xml')
configFile file('config/checkstyle/google_checks.xml')
}
tasks.withType(Checkstyle) {
reports {
xml.enabled = false
html.enabled = true
xml.required = false
html.required = true
}
}
task downloadTests() {
def unzipDir = new File('src/test/java/de/hda/fbi/db2/test')
def gitURL = 'https://code.fbi.h-da.de/db2-praktikum/base-project/-/archive/master/base-project-master.zip?path=src%2Ftest%2Fjava%2Fde%2Fhda%2Ffbi%2Fdb2%2Ftest'
tasks.register('downloadTestClasses') {
description('Replaces the local test classes with the test classes from the remote base '
+ 'project. WARNING: This overwrites local changes!')
def zipFile = new File(unzipDir, 'tests.zip')
def myZipTree = zipTree(zipFile)
doLast {
def unzipDir = new File('src/test/java/de/hda/fbi/db2/test')
def gitURL = 'https://code.fbi.h-da.de/db2-praktikum/base-project/-/archive/master/base-project-master.zip?path=src%2Ftest%2Fjava%2Fde%2Fhda%2Ffbi%2Fdb2%2Ftest'
download {
src gitURL
dest zipFile
}
download {
src gitURL
dest 'tests.zip'
}
copy {
from myZipTree.getFiles()
into unzipDir
}
copy {
from zipTree('tests.zip').getFiles()
into unzipDir
}
delete zipFile
delete 'tests.zip'
}
}
// Specify Java version used to build this project
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
compile 'com.google.guava:guava:23.0'
compile group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.2.1'
// Use eclipselink JPA Implementation
compile('org.eclipse.persistence:eclipselink:2.7.4') {
exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
}
//Oracle JDBC Driver and any other libraries from 'libs' folder since not available in public maven
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.eclipse.persistence:eclipselink:2.7.9'
// https://mvnrepository.com/artifact/org.postgresql/postgresql
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.1'
implementation 'org.postgresql:postgresql:42.3.1'
def spotBugsAnnotationsVersion = '4.5.0'
// SpotBugs annotations to suppress warnings about false positives
compileOnly "com.github.spotbugs:spotbugs-annotations:$spotBugsAnnotationsVersion"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:$spotBugsAnnotationsVersion"
// Use JUnit test framework
testCompile 'junit:junit:4.12'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
}
test {
// Use JUnit 5 for tests
useJUnitPlatform()
// Pass system property to test JVM, see https://stackoverflow.com/a/21406600
systemProperty 'ci-server', System.getProperty('ci-server')
// Log information while running tests
testLogging {
events 'passed', 'skipped', 'failed'
showExceptions true
exceptionFormat 'full'
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
// Attach stdin to gradle run
......
This diff is collapsed.
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
- the Javadoc guidelines at
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
https://checkstyle.org (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.
Finally, it is worth reading the documentation.
-->
<module name="Checker">
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
http://checkstyle.sourceforge.net/5.x/config.html#Checker
https://checkstyle.org/5.x/config.html#Checker
<property name="basedir" value="${basedir}"/>
-->
<property name="severity" value="error"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
<property name="optional" value="true"/>
</module>
<!-- Checks that a package-info.java file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<module name="JavadocPackage"/>
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<!-- See https://checkstyle.org/config_misc.html#Translation -->
<module name="Translation"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
......@@ -59,7 +89,7 @@
</module>
<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- See https://checkstyle.org/config_header.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
......@@ -68,14 +98,16 @@
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
<module name="MissingJavadocMethod"/>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<!-- See https://checkstyle.org/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
......@@ -87,7 +119,7 @@
<module name="TypeName"/>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<!-- See https://checkstyle.org/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
......@@ -96,13 +128,12 @@
</module>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength"/>
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
......@@ -115,12 +146,12 @@
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!-- See https://checkstyle.org/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!-- See https://checkstyle.org/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
......@@ -128,8 +159,7 @@
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="AvoidInlineConditionals"/>
<!-- See https://checkstyle.org/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField"/>
......@@ -137,11 +167,12 @@
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- See https://checkstyle.org/config_design.html -->
<module name="DesignForExtension"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
......@@ -149,12 +180,19 @@
<module name="VisibilityModifier"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment"/>
<module name="UpperEll"/>
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>
</module>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<!--
# Copyright 2015 WSO2 Inc. (http://wso2.org)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- This is a checkstyle configuration file. For descriptions of
what the following rules do, please see the checkstyle configuration
page at http://checkstyle.sourceforge.net/config.html -->
<module name="Checker">
<module name="FileTabCharacter">
<property name="severity" value="error" />
<!-- Checks that there are no tab characters in the file.
-->
</module>
<!--
LENGTH CHECKS FOR FILES
-->
<module name="FileLength">
<property name="max" value="3000" />
<property name="severity" value="warning" />
</module>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
<module name="RegexpSingleline">
<property name="format" value="((//.*)|(\*.*))FIXME" />
<property name="message" value='TODO is preferred to FIXME. e.g. "TODO: (ENG-123) - Refactor when v2 is released."' />
</module>
<module name="RegexpSingleline">
<property name="format" value="((//.*)|(\*.*))TODO[^: (]" />
<property name="message" value='All TODOs should be named. e.g. "TODO: (ENG-123) - Refactor when v2 is released."' />
</module>
<!--<module name="JavadocPackage">-->
<!--&lt;!&ndash; Checks that each Java package has a Javadoc file used for commenting.-->
<!--Only allows a package-info.java, not package.html. &ndash;&gt;-->
<!--<property name="severity" value="warning"/>-->
<!--</module>-->
<!-- All Java AST specific tests live under TreeWalker module. -->
<module name="TreeWalker">
<!-- required for SupressionCommentFilter and SuppressWithNearbyCommentFilter -->
<module name="FileContentsHolder" />
<!--
IMPORT CHECKS
-->
<module name="AvoidStarImport">
<property name="allowClassImports" value="false" />
<property name="severity" value="error" />
</module>
<module name="RedundantImport">
<!-- Checks for redundant import statements. -->
<property name="severity" value="error" />
</module>
<module name="ImportOrder">
<!-- Checks for out of order import statements. -->
<property name="severity" value="error" />
<property name="ordered" value="true" />
<property name="groups" value="/([^j]|.[^a]|..[^v]|...[^a])/,/^javax?\./" />
<!-- This ensures that static imports go to the end. -->
<property name="option" value="bottom" />
<property name="tokens" value="STATIC_IMPORT, IMPORT" />
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="junit.framework" />
</module>
<module name="UnusedImports" />
<!--
METHOD LENGTH CHECKS
-->
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF" />
<property name="max" value="300" />
<property name="countEmpty" value="false" />
<property name="severity" value="warning" />
</module>
<!--
JAVADOC CHECKS
-->
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="protected" />
<property name="severity" value="error" />
<property name="allowMissingJavadoc" value="true" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
<property name="allowMissingThrowsTags" value="true" />
<property name="allowThrowsTagsForSubclasses" value="true" />
<property name="allowUndeclaredRTE" value="true" />
</module>
<module name="JavadocType">
<property name="scope" value="protected" />
<property name="severity" value="error" />
</module>
<module name="JavadocStyle">
<property name="severity" value="error" />
</module>
<!--
NAMING CHECKS
-->
<!-- Item 38 - Adhere to generally accepted naming conventions -->
<module name="PackageName">
<!-- Validates identifiers for package names against the
supplied expression. -->
<!-- Here the default checkstyle rule restricts package name parts to
seven characters, this is not in line with common practice at Google.
-->
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,})*$" />
<property name="severity" value="error" />
</module>
<module name="TypeNameCheck">
<!-- Validates static, final fields against the
expression "^[A-Z][a-zA-Z0-9]*$". -->
<metadata name="altname" value="TypeName" />
<property name="severity" value="error" />
</module>
<module name="ConstantNameCheck">
<!-- Validates non-private, static, final fields against the supplied
public/package final fields "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$". -->
<metadata name="altname" value="ConstantName" />
<property name="applyToPublic" value="true" />
<property name="applyToProtected" value="true" />
<property name="applyToPackage" value="true" />
<property name="applyToPrivate" value="false" />
<property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|FLAG_.*)$" />
<message key="name.invalidPattern"
value="Variable ''{0}'' should be in ALL_CAPS (if it is a constant) or be private (otherwise)." />
<property name="severity" value="error" />
</module>
<module name="StaticVariableNameCheck">
<!-- Validates static, non-final fields against the supplied
expression "^[a-z][a-zA-Z0-9]*_?$". -->
<metadata name="altname" value="StaticVariableName" />
<property name="applyToPublic" value="true" />
<property name="applyToProtected" value="true" />
<property name="applyToPackage" value="true" />
<property name="applyToPrivate" value="true" />
<property name="format" value="^[a-z][a-zA-Z0-9]*_?$" />
<property name="severity" value="error" />
</module>
<module name="MemberNameCheck">
<!-- Validates non-static members against the supplied expression. -->
<metadata name="altname" value="MemberName" />
<property name="applyToPublic" value="true" />
<property name="applyToProtected" value="true" />
<property name="applyToPackage" value="true" />
<property name="applyToPrivate" value="true" />
<property name="format" value="^[a-z][a-zA-Z0-9]*$" />
<property name="severity" value="error" />
</module>
<module name="MethodNameCheck">
<!-- Validates identifiers for method names. -->
<metadata name="altname" value="MethodName" />
<property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$" />
<property name="severity" value="error" />
</module>
<module name="ParameterName">
<!-- Validates identifiers for method parameters against the
expression "^[a-z][a-zA-Z0-9]*$". -->
<property name="severity" value="error" />
</module>
<module name="LocalFinalVariableName">
<!-- Validates identifiers for local final variables against the
expression "^[a-z][a-zA-Z0-9]*$". -->
<property name="severity" value="error" />
</module>
<module name="LocalVariableName">
<!-- Validates identifiers for local variables against the
expression "^[a-z][a-zA-Z0-9]*$". -->
<property name="severity" value="error" />
</module>
<!--
LENGTH and CODING CHECKS
-->
<module name="LineLength">
<!-- Checks if a line is too long. -->
<property name="max" value="120" default="120" />
<property name="severity" value="error" />
<!--
The default ignore pattern exempts the following elements:
- import statements
- long URLs inside comments
-->
<property name="ignorePattern" value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *\* *https?://.*)$" />
</module>
<module name="LeftCurly">
<!-- Checks for placement of the left curly brace ('{'). -->
<property name="severity" value="error" />
</module>
<module name="RightCurly">
<!-- Checks right curlies on CATCH, ELSE, and TRY blocks are on
the same line. e.g., the following example is fine:
<pre>
if {
...
} else
</pre>
-->
<!-- This next example is not fine:
<pre>
if {
...
}
else
</pre>
-->
<property name="option" value="same" />
<property name="severity" value="error" />
</module>
<!-- Checks for braces around if and else blocks -->
<module name="NeedBraces">
<property name="severity" value="error" />
<property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO" />
</module>
<module name="UpperEll">
<!-- Checks that long constants are defined with an upper ell.-->
<property name="severity" value="error" />
</module>
<module name="FallThrough">
<!-- Warn about falling through to the next case statement. Similar to
javac -Xlint:fallthrough, but the check is suppressed if a single-line comment
on the last non-blank line preceding the fallen-into case contains 'fall through' (or
some other variants which we don't publicized to promote consistency).
-->
<property name="reliefPattern"
value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on" />
<property name="severity" value="error" />
</module>
<!--
MODIFIERS CHECKS
-->
<module name="ModifierOrder">
<!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
8.4.3. The prescribed order is:
public, protected, private, abstract, static, final, transient, volatile,
synchronized, native, strictfp
-->
</module>
<!--
WHITESPACE CHECKS
-->
<module name="GenericWhitespace" />
<module name="WhitespaceAround">
<!-- Checks that various tokens are surrounded by whitespace.
This includes most binary operators and keywords followed
by regular or curly braces.
-->
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR,
BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION,
SL, SLIST, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN" />
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="severity" value="error" />
</module>
<module name="WhitespaceAfter">
<!-- Checks that commas, semicolons and typecasts are followed by
whitespace.
-->
<property name="tokens" value="COMMA, SEMI, TYPECAST" />
<property name="severity" value="error" />
</module>
<module name="NoWhitespaceAfter">
<!-- Checks that there is no whitespace after various unary operators.
Linebreaks are allowed.
-->
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS,
UNARY_PLUS" />
<property name="allowLineBreaks" value="true" />
<property name="severity" value="error" />
</module>
<module name="NoWhitespaceBefore">
<!-- Checks that there is no whitespace before various unary operators.
Linebreaks are allowed.
-->
<property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC" />
<property name="allowLineBreaks" value="true" />
<property name="severity" value="error" />
</module>
<module name="ParenPad">
<!-- Checks that there is no whitespace before close parens or after
open parens.
-->
<property name="severity" value="error" />
</module>
<!-- No System.out -->
<module name="Regexp">
<property name="format" value="System\.out\.println" />
<property name="illegalPattern" value="true" />
</module>
<!-- No System.err -->
<module name="Regexp">
<!-- . matches any character, so we need to escape it and use \. to match dots. -->
<property name="format" value="System\.err\.println" />
<property name="illegalPattern" value="true" />
</module>
<!-- No printStackTrace -->
<module name="Regexp">
<!-- . matches any character, so we need to escape it and use \. to match dots. -->
<property name="format" value="e\.printStackTrace\(\)" />
<property name="illegalPattern" value="true" />
</module>
</module>
<!--module name="SuppressionFilter">
<property name="file" value="suppressions.xml"/>
</module-->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE OFF: (.+)" />
<property name="onCommentFormat" value="CHECKSTYLE ON" />
<property name="checkFormat" value="Javadoc.*" />
<property name="messageFormat" value="$1" />
</module>
</module>
FROM openjdk:11
ENV GRADLE_USER_HOME=/workspace/.gradle
COPY ./ /workspace
WORKDIR /workspace
RUN ls -la && \
chmod +x ./gradlew && \
./gradlew assemble && \
ls -la && \
mkdir /dependencies && \
cp -r build /dependencies && \
cp -r .gradle /dependencies && \
cd / && rm -r workspace
File moved
No preview for this file type
#Sat Mar 09 13:39:39 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
......@@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
......@@ -89,84 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
i=$((i+1))
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
......@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
......@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
......@@ -45,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
......
File deleted
# Einführung in Git und GitLab
## Ziel
[Git](https://git-scm.com/) ist eine populäre Software zur (verteilten) Versionsverwaltung von Dateien. Sie wurde initial von [Linux Torvalds](https://en.wikipedia.org/wiki/Linus_Torvalds) für den [Linux Kernel](https://en.wikipedia.org/wiki/Linux_kernel) enwickelt und gilt heute als Standard in der Software Entwicklung.
[Git](https://git-scm.com/) ist eine populäre Software zur (verteilten) Versionsverwaltung von Dateien. Sie wurde initial von [Linux Torvalds](https://en.wikipedia.org/wiki/Linus_Torvalds) für den [Linux Kernel](https://en.wikipedia.org/wiki/Linux_kernel) entwickelt und gilt heute als Standard in der Software Entwicklung.
[GitLab](https://about.gitlab.com/) ist, ähnlich wie [GitHub](https://github.com/), eine Weboberfläche zum Verwalten von Git-Repositories. Das folgende Dokument führt in die für dieses Praktikum benötigte Infrastruktur und Software ein.
## Clonen eines Projekts von Gitlab
Um die Arbeit zu erleichtern, finden Sie in diesem Repository einen vorbereiteten Projektrahmen. Als erstes müssen Sie sich eine lokale Kopie des Projektes erzeugen – dieser Schritt heißt bei Git clonen. Sie können das Clonen mit den installierten Git-Tools (vgl. „Benötigte Software für die Arbeit mit Git“) über das Dateisystem (git clone) oder über **IntelliJ** ausführen:
Um die Arbeit zu erleichtern, finden Sie in diesem Repository einen vorbereiteten Projektrahmen. Als Erstes müssen Sie sich eine lokale Kopie des Projektes erzeugen – dieser Schritt heißt bei Git clonen. Sie können das Clonen mit den installierten Git-Tools (vgl. „Benötigte Software für die Arbeit mit Git“) über das Dateisystem (`git clone`) oder über **IntelliJ** ausführen:
- VCS &rarr; Git &rarr; Clone
- Im Feld URL die URL Ihres Repositorys eintragen.
- Im Feld URL die URL Ihres Repositorys eintragen.
- Unter Directory ein geeignetes Verzeichnis auf Ihrem Rechner auswählen.
- Alle weiteren Angaben im IntelliJ-Dialog können Sie unverändert übernehmen.
Das vorbereitete Projekt kann in IntelliJ direkt und ohne weitere Anpassungen verwendet werden. Das eingesetzte Build-Automatisierungssystem heißt Gradle und muss von Ihnen in der Regel nicht angepasst werden, da bereits alles lauffähig konfiguriert ist und stelle eine Menge vorbereiteter Tasks, wie check, build, run, etc., zur Verfügung.
Das vorbereitete Projekt kann in IntelliJ direkt und ohne weitere Anpassungen verwendet werden. Das eingesetzte Build-Automatisierungssystem heißt Gradle und muss von Ihnen in der Regel nicht angepasst werden, da bereits alles lauffähig konfiguriert ist und stellt eine Menge vorbereiteter Tasks, wie check, build, run, etc., zur Verfügung.
Der Projektrahmen ist in folgende Bereiche aufgeteilt:
- In src &rarr; main &rarr; java werden die Java-Sources abgespeichert. Das Package de.hda.fbi.db2 ist bereits eingerichtet.
- In src &rarr; main &rarr; java werden die Java-Sources abgespeichert. Das Package `de.hda.fbi.db2` ist bereits eingerichtet.
- In src &rarr; main &rarr; resources werden die zum Projekt gehörenden Ressource-Dateien abgespeichert.
**Hinweis**: Alle von Ihnen entwickelten Java-Klassen und -Packages müssen als Unter-Packages von de.hda.fbi.db2.stud abgelegt werden, damit der automatisierte Build-Prozess (vgl. „Weitere Hinweise zur Arbeit mit GitLab“) funktioniert!
**Hinweis**: Alle von Ihnen entwickelten Java-Klassen und -Packages müssen als Unter-Packages von `de.hda.fbi.db2.stud` abgelegt werden, damit der automatisierte Build-Prozess (vgl. „Weitere Hinweise zur Arbeit mit GitLab“) funktioniert!
**Beispiel**: de.hda.fbi.db2.stud.entity
**Beispiel**: `de.hda.fbi.db2.stud.entity`
### Wichtige Git-Kommandos
**Add** *(Selektieren Ihrer Änderungen zum Commit)*: `git add`<br/>
......@@ -42,7 +42,7 @@ Lädt Änderungen vom Server herunter. Ggf. müssen diese Änderungen mit den lo
Für Studierende, die über keine Erfahrung mit Git verfügen, empfehlen wir, nicht gleichzeitig an mehreren Rechnern zu arbeiten, und jeweils unmittelbar *vor* der Arbeit ein Pull und unmittelbar *nach* der Arbeit ein Push zu machen (Commit vor dem Push nicht vergessen!).
Des weitern empfehlen wir unerfahrenen Studierenden folgende Links:
Des Weiteren empfehlen wir unerfahrenen Studierenden folgende Links:
- [Buch: *Git Pro*](https://git-scm.com/book/en/v2) (verfügbar in verschiedenen Sprachen)Gutes Buch zu Git, mit vielen (sehr vielen) Beispielen. Das Buch steht unter Creative Commons Attribution Non Commercial Share Alike 3.0 license. Es ist in verschiedenen Sprachen und Formaten verfügbar.
- [Comparing Workflows](https://www.atlassian.com/git/tutorials/comparing-workflows) eine gute Einführung in die Git-Workflows.
- [learngitbranching.js.org](https://learngitbranching.js.org/) Tutorial zum Thema Git Branching
......
......@@ -18,7 +18,7 @@ public class Main {
Controller controller = Controller.getInstance();
//TODO(stud): uncomment for lab01
controller.readCsv();
//controller.readCsv();
//TODO(stud): uncomment for lab02
//controller.persistData();
......
......@@ -3,32 +3,35 @@ package de.hda.fbi.db2.api;
import java.util.List;
/**
* API Class for lab01
* Created by l.koehler on 05.08.2019.
* API Class for lab01 Created by l.koehler on 05.08.2019.
*/
public abstract class Lab01Data {
public void init() {
}
/**
* Can be overridden to perform additional initialization tasks.
*/
public void init() {
}
/**
* Return all questions.
*
* @return questions
*/
public abstract List<Object> getQuestions();
/**
* Return all questions.
*
* @return questions
*/
public abstract List<?> getQuestions();
/**
* Return all categories.
*
* @return categories
*/
public abstract List<Object> getCategories();
/**
* Return all categories.
*
* @return categories
*/
public abstract List<?> getCategories();
/**
* Save the csv data in appropriate objects.
*
* @param additionalCsvLines is the csv data
*/
public abstract void loadCsvFile(List<String[]> additionalCsvLines);
/**
* Save the CSV data in appropriate objects.
*
* @param csvLines CSV lines, each line is a String array consisting of the columns of the line.
* The first line consists of the headers of the CSV columns.
*/
public abstract void loadCsvFile(List<String[]> csvLines);
}