Skip to content

Commit

Permalink
chore: fix and configure compiler and build options
Browse files Browse the repository at this point in the history
  • Loading branch information
j0a0m4 committed Jun 19, 2023
1 parent d743926 commit 5a0fe71
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 18 deletions.
19 changes: 19 additions & 0 deletions .run/Build App in Container.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build App in Container" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="" />
<option name="portBindings">
<list>
<DockerPortBindingImpl>
<option name="containerPort" value="8080" />
<option name="hostPort" value="8080" />
</DockerPortBindingImpl>
</list>
</option>
<option name="sourceFilePath" value="Dockerfile.build" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
15 changes: 15 additions & 0 deletions .run/Run App Locally.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run App Locally" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="ports-and-adapters.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="io.j0a0m4.portsandadapters.PortsAndAdaptersApplication" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="io.j0a0m4.portsandadapters.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
19 changes: 19 additions & 0 deletions .run/Run App in Container.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run App in Container" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="" />
<option name="portBindings">
<list>
<DockerPortBindingImpl>
<option name="containerPort" value="8080" />
<option name="hostPort" value="8080" />
</DockerPortBindingImpl>
</list>
</option>
<option name="sourceFilePath" value="Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions .run/Test App Locally.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test App Locally" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<ForceTestExec>true</ForceTestExec>
<method v="2" />
</configuration>
</component>
11 changes: 11 additions & 0 deletions .run/Test App in Container.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test App in Container" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="" />
<option name="sourceFilePath" value="Dockerfile.test" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM eclipse-temurin:20.0.1_9-jdk-alpine as gradle
FROM eclipse-temurin:19.0.2_7-jdk-alpine as gradle
RUN apk add --no-cache gradle

FROM gradle as builder
USER root
ENV APP_HOME=/builder
WORKDIR $APP_HOME
COPY . $APP_HOME
RUN gradle build --stacktrace --no-daemon
RUN gradle build --exclude-task test --stacktrace --no-daemon --no-build-cache --parallel

FROM eclipse-temurin:20.0.1_9-jdk-alpine
FROM eclipse-temurin:19.0.2_7-jre-alpine
WORKDIR /app
expose 8080
COPY --from=builder "/builder/build/libs/ports-and-adapters-0.0.1-SNAPSHOT.jar" .
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM eclipse-temurin:20.0.1_9-jdk-alpine as gradle
FROM eclipse-temurin:19.0.2_7-jdk-alpine as gradle
RUN apk add --no-cache gradle

FROM gradle as builder
USER root
ENV APP_HOME=/builder
WORKDIR $APP_HOME
COPY . $APP_HOME
RUN gradle build --stacktrace --no-daemon
RUN gradle gradle dist --exclude-task test --stacktrace --no-daemon --no-build-cache --parallel
4 changes: 2 additions & 2 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM eclipse-temurin:20.0.1_9-jdk-alpine as gradle
FROM eclipse-temurin:19.0.2_7-jdk-alpine as gradle
RUN apk add --no-cache gradle

FROM gradle as builder
USER root
ENV APP_HOME=/builder
WORKDIR $APP_HOME
COPY . $APP_HOME
RUN gradle test --stacktrace --no-daemon
RUN gradle test --stacktrace --no-daemon --no-build-cache --parallel
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group = "io.j0a0m4"
version = "0.0.1-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_19
}

repositories {
Expand All @@ -40,7 +40,7 @@ dependencies {
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
jvmTarget = "19"
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.parallel=true
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# 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
# https://github.com/gradle/gradle/blob/HEAD/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/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
rootProject.name = "ports-and-adapters"

0 comments on commit 5a0fe71

Please sign in to comment.