Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src"/>
<classpathentry kind="src" output="bin/test" path="test">
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="icons"/>
<classpathentry kind="src" output="bin/main" path="tipdata"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/jetuml"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Java CI with Gradle

on:
push:
branches: [ develop, 'feature/**' ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle Wrapper
run: ./gradlew build --no-daemon

- name: Upload build artifacts (JAR)
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/libs/**

- name: Run Unit Tests
run: ./gradlew test --no-daemon

- name: Upload Test Reports
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
build/test-results/test/**
build/reports/tests/**

- name: Generate Code Coverage Report
run: ./gradlew jacocoTestReport --no-daemon

- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: build/reports/jacoco/test/html/**
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
hs_err_pid*
/bin/
/.settings/
/test.svg
/test.svg

# Ignore Gradle project-specific cache directory
.gradle

17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
Expand All @@ -19,5 +24,17 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1757075136769</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM eclipse-temurin:21-jdk

# Install necessary Linux GUI libraries
RUN apt-get update && apt-get install -y \
wget unzip \
libgtk-3-0 libxext6 libxrender1 libxtst6 libxi6 libxrandr2 libnss3 \
libasound2t64 libfreetype6 libcups2 libxcomposite1 libxdamage1 libxfixes3 libx11-xcb1

# Download and unpack JavaFX
RUN wget https://download2.gluonhq.com/openjfx/21.0.8/openjfx-21.0.8_linux-x64_bin-sdk.zip && \
unzip openjfx-21.0.8_linux-x64_bin-sdk.zip -d /opt && \
rm openjfx-21.0.8_linux-x64_bin-sdk.zip

# Set working directory
WORKDIR /app

# Copy your JAR
COPY build/libs/JetUML-1.0.0.jar .

# Launch JetUML with JavaFX
CMD ["java", "--module-path", "/opt/javafx-sdk-21.0.8/lib", "--add-modules", "javafx.controls,javafx.fxml", "-jar", "JetUML-1.0.0.jar"]
59 changes: 59 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
id 'java'
id 'application'
id 'jacoco'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

group = 'com.jetuml'
version = '1.0.0'

repositories { mavenCentral() }

java {
toolchain { languageVersion = JavaLanguageVersion.of(17) }
}

application {
mainClass = 'ca.prmr.JetUML.JetUML'
}

test {
useJUnitPlatform()
testLogging { events "passed", "skipped", "failed" }
}

sourceSets {
main {
java {
srcDirs = ['src']
exclude 'test/**'
}
resources {
srcDirs = ['src']
exclude 'test/**'
}
}
test {
java.srcDirs = ['src/test/java']
resources.srcDirs = ['src/test/resources']
}
}

javafx {
version = '17.0.9'
modules = ['javafx.controls', 'javafx.graphics', 'javafx.swing']
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.11.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
testImplementation 'junit:junit:4.13.2'
}

jacocoTestReport {
dependsOn test
reports { xml.required.set(true); html.required.set(true) }
}
Binary file added build/distributions/JetUML-1.0.0.tar
Binary file not shown.
Binary file added build/distributions/JetUML-1.0.0.zip
Binary file not shown.
Binary file added build/jacoco/test.exec
Binary file not shown.
Binary file added build/libs/JetUML-1.0.0.jar
Binary file not shown.
Loading