Skip to content

Commit

Permalink
ci: snippets compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed May 23, 2024
1 parent 13438db commit e940352
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/compilation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Compilation

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Building
run: |
./compile.sh
4 changes: 4 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

(cd snippets && mvn clean spotless:apply compile)

94 changes: 94 additions & 0 deletions snippets/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.sinch.sdk.archetypes</groupId>
<artifactId>sinch-java-sdk-client-snippets</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Sinch Java SDK Client Snippets</name>

<properties>
<sinch.sdk.java.version>[1.0.0,)</sinch.sdk.java.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.version>3.8.0</maven.compiler.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>.</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<!-- code format -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.40.0</version>

<configuration>

<java>
<includes>
<include>**/*.java</include>
</includes>

<googleJavaFormat>
<version>1.22.0</version>
<style>AOSP</style>
<reflowLongStrings>true</reflowLongStrings>
</googleJavaFormat>
<endWithNewline />
<removeUnusedImports />
<indent>
<spaces>true</spaces>
<spacesPerTab>2</spacesPerTab>
</indent>
<trimTrailingWhitespace />
</java>

</configuration>

<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.sinch.sdk</groupId>
<artifactId>sinch-sdk-java</artifactId>
<version>${sinch.sdk.java.version}</version>
</dependency>

</dependencies>

</project>

0 comments on commit e940352

Please sign in to comment.