Skip to content

Commit b8cefb9

Browse files
committed
Initial migration to Maven modules
1 parent f113299 commit b8cefb9

194 files changed

Lines changed: 420 additions & 205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g. 1.2.0)'
8+
required: true
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- uses: actions/setup-java@v4
19+
with:
20+
java-version: '25'
21+
distribution: 'temurin'
22+
server-id: central
23+
server-username: CENTRAL_USERNAME
24+
server-password: CENTRAL_PASSWORD
25+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
gpg-passphrase: GPG_PASSPHRASE
27+
28+
- name: Configure git
29+
run: |
30+
git config user.name "github-actions"
31+
git config user.email "github-actions@github.com"
32+
33+
- name: Set release version
34+
run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
35+
36+
- name: Commit and tag
37+
run: |
38+
git commit -am "Release ${{ github.event.inputs.version }}"
39+
git tag v${{ github.event.inputs.version }}
40+
41+
- name: Deploy to Central
42+
run: mvn -B clean deploy -Prelease
43+
env:
44+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
45+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
46+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
47+
48+
- name: Bump to next snapshot
49+
run: |
50+
mvn -B versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
51+
git commit -am "Prepare next development iteration"
52+
53+
- name: Push commits and tag
54+
run: git push origin main --tags

matrix-sdk-benchmarks/pom.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>io.github.hikingc</groupId>
6+
<artifactId>java-matrix-sdk</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
</parent>
9+
10+
<artifactId>matrix-sdk-benchmarks</artifactId>
11+
<packaging>jar</packaging>
12+
13+
<name>matrix-sdk-benchmarks</name>
14+
<url>http://maven.apache.org</url>
15+
16+
<properties>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>junit</groupId>
23+
<artifactId>junit</artifactId>
24+
<version>3.8.1</version>
25+
<scope>test</scope>
26+
</dependency>
27+
<dependency>
28+
<groupId>io.github.hikingc</groupId>
29+
<artifactId>matrix-sdk-core</artifactId>
30+
<version>1.0-SNAPSHOT</version>
31+
<scope>compile</scope>
32+
</dependency>
33+
</dependencies>
34+
</project>

examples/setUpClientPrints/Main.java renamed to matrix-sdk-benchmarks/src/main/java/io/github/hikingc/benchmarks/App.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package setUpClientPrints;
1+
package io.github.hikingc.benchmarks;
22

33
import io.github.hikingc.matrixsdk.api.MatrixAuth;
44
import io.github.hikingc.matrixsdk.api.MatrixClient;
@@ -8,20 +8,19 @@
88
import io.github.hikingc.matrixsdk.api.events.queries.QueryParametersSync;
99
import io.github.hikingc.matrixsdk.api.events.sync.Sync;
1010
import io.github.hikingc.matrixsdk.api.identifiers.RoomID;
11-
import org.slf4j.Logger;
12-
import org.slf4j.LoggerFactory;
13-
1411
import java.net.URI;
1512
import java.net.http.HttpClient;
13+
import org.slf4j.Logger;
14+
import org.slf4j.LoggerFactory;
1615

17-
public class Main {
18-
private static final Logger log = LoggerFactory.getLogger(Main.class);
16+
public class App {
17+
private static final Logger log = LoggerFactory.getLogger(App.class);
1918

20-
static void main() {
19+
static void main() {
2120
HttpClient httpClient =
2221
HttpClient.newBuilder().build(); // Create a client, this will do for this example.
2322
MatrixAuth auth =
24-
new MatrixAuth(URI.create("https://example.org"), httpClient); // Set the URI and the client
23+
new MatrixAuth(URI.create("https://kde.org"), httpClient); // Set the URI and the client
2524
TokenMetadata res =
2625
auth.performOAuthLogin(
2726
"clienttest", 8080, "defgagagea"); // Perform interactive login (browser needed)
@@ -35,7 +34,13 @@ static void main() {
3534
client
3635
.events()
3736
.sync(
38-
new QueryParametersSync(null, true, null, null, 100, true)); // Perform operations.
37+
new QueryParametersSync(
38+
"{\"room\":{\"timeline\":{\"unread_thread_notifications\":true,\"limit\":20},\"state\":{\"lazy_load_members\":true}}}",
39+
true,
40+
null,
41+
null,
42+
0,
43+
true)); // Perform operations.
3944
log.info(String.valueOf(sync)); // This endpoint will take a while, you have been warned...
4045

4146
try {
@@ -45,7 +50,7 @@ static void main() {
4550
.getInitialSync(
4651
RoomID.create(
4752
"!foobar:example.org")); // Type safe identifiers, will crash if given wrong
48-
// format.
53+
// format.
4954
log.info(roomInfo.visibility());
5055
} catch (IllegalArgumentException e) {
5156
log.info("Room id is bad!, Reason: {}", e.getMessage());
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import junit.framework.Test;
2+
import junit.framework.TestCase;
3+
import junit.framework.TestSuite;
4+
5+
/**
6+
* Unit test for simple io.github.hikingc.benchmarks.App.
7+
*/
8+
public class AppTest
9+
extends TestCase
10+
{
11+
/**
12+
* Create the test case
13+
*
14+
* @param testName name of the test case
15+
*/
16+
public AppTest( String testName )
17+
{
18+
super( testName );
19+
}
20+
21+
/**
22+
* @return the suite of tests being tested
23+
*/
24+
public static Test suite()
25+
{
26+
return new TestSuite( AppTest.class );
27+
}
28+
29+
/**
30+
* Rigourous Test :-)
31+
*/
32+
public void testApp()
33+
{
34+
assertTrue( true );
35+
}
36+
}

matrix-sdk-core/pom.xml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>io.github.hikingc</groupId>
6+
<artifactId>java-matrix-sdk</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
</parent>
9+
10+
<artifactId>matrix-sdk-core</artifactId>
11+
<packaging>jar</packaging>
12+
13+
<name>matrix-sdk-core</name>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>tools.jackson.core</groupId>
22+
<artifactId>jackson-databind</artifactId>
23+
<scope>compile</scope>
24+
</dependency>
25+
26+
27+
<dependency>
28+
<groupId>io.fusionauth</groupId>
29+
<artifactId>java-http</artifactId>
30+
</dependency>
31+
32+
<dependency>
33+
<groupId>org.jspecify</groupId>
34+
<artifactId>jspecify</artifactId>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.slf4j</groupId>
39+
<artifactId>slf4j-api</artifactId>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>org.junit.jupiter</groupId>
44+
<artifactId>junit-jupiter</artifactId>
45+
<scope>test</scope>
46+
</dependency>
47+
48+
<!-- Testing deps -->
49+
50+
<dependency>
51+
<groupId>org.wiremock</groupId>
52+
<artifactId>wiremock</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.assertj</groupId>
58+
<artifactId>assertj-core</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
62+
<dependency>
63+
<groupId>org.instancio</groupId>
64+
<artifactId>instancio-junit</artifactId>
65+
<version>6.0.0-RC4</version>
66+
<scope>test</scope>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>org.slf4j</groupId>
71+
<artifactId>slf4j-simple</artifactId>
72+
<version>2.0.18</version>
73+
<scope>test</scope>
74+
</dependency>
75+
76+
<!-- publishing -->
77+
<dependency>
78+
<groupId>org.sonatype.central</groupId>
79+
<artifactId>central-publishing-maven-plugin</artifactId>
80+
<version>0.11.0</version>
81+
</dependency>
82+
</dependencies>
83+
84+
<build>
85+
<plugins>
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-source-plugin</artifactId>
89+
<version>3.4.0</version>
90+
<executions>
91+
<execution>
92+
<id>attach-sources</id>
93+
<goals>
94+
<goal>jar-no-fork</goal>
95+
</goals>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
100+
<!-- Generates <artifactId>-<version>-javadoc.jar -->
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-javadoc-plugin</artifactId>
104+
<configuration>
105+
<tags>
106+
<tag>
107+
<name>apiNote</name>
108+
<placement>a</placement>
109+
<head>API Note:</head>
110+
</tag>
111+
<tag>
112+
<name>implSpec</name>
113+
<placement>a</placement>
114+
<head>Implementation Requirements:</head>
115+
</tag>
116+
<tag>
117+
<name>implNote</name>
118+
<placement>a</placement>
119+
<head>Implementation Note:</head>
120+
</tag>
121+
</tags>
122+
</configuration>
123+
<version>3.12.0</version>
124+
<executions>
125+
<execution>
126+
<id>attach-javadocs</id>
127+
<goals>
128+
<goal>jar</goal>
129+
</goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
134+
135+
<plugin>
136+
<groupId>org.apache.maven.plugins</groupId>
137+
<artifactId>maven-gpg-plugin</artifactId>
138+
<version>3.2.8</version>
139+
<executions>
140+
<execution>
141+
<id>sign-artifacts</id>
142+
<phase>verify</phase>
143+
<goals>
144+
<goal>sign</goal>
145+
</goals>
146+
</execution>
147+
</executions>
148+
</plugin>
149+
150+
151+
<plugin>
152+
<groupId>org.jacoco</groupId>
153+
<artifactId>jacoco-maven-plugin</artifactId>
154+
<version>0.8.15</version>
155+
156+
157+
<executions>
158+
<execution>
159+
<id>prepare-agent</id>
160+
<goals>
161+
<goal>prepare-agent</goal>
162+
</goals>
163+
</execution>
164+
<execution>
165+
<id>report</id>
166+
<phase>test</phase>
167+
<goals>
168+
<goal>report</goal>
169+
</goals>
170+
</execution>
171+
<execution>
172+
<id>check</id>
173+
<goals>
174+
<goal>check</goal>
175+
</goals>
176+
<configuration>
177+
<rules>
178+
<rule>
179+
<element>BUNDLE</element>
180+
<limits>
181+
<limit>
182+
<counter>LINE</counter>
183+
<value>COVEREDRATIO</value>
184+
<minimum>0.80</minimum>
185+
</limit>
186+
</limits>
187+
</rule>
188+
</rules>
189+
</configuration>
190+
</execution>
191+
</executions>
192+
</plugin>
193+
</plugins>
194+
</build>
195+
</project>

src/main/java/io/github/hikingc/matrixsdk/api/Auth.java renamed to matrix-sdk-core/src/main/java/io/github/hikingc/matrixsdk/api/Auth.java

File renamed without changes.

src/main/java/io/github/hikingc/matrixsdk/api/Event.java renamed to matrix-sdk-core/src/main/java/io/github/hikingc/matrixsdk/api/Event.java

File renamed without changes.

src/main/java/io/github/hikingc/matrixsdk/api/Filter.java renamed to matrix-sdk-core/src/main/java/io/github/hikingc/matrixsdk/api/Filter.java

File renamed without changes.

src/main/java/io/github/hikingc/matrixsdk/api/MatrixAuth.java renamed to matrix-sdk-core/src/main/java/io/github/hikingc/matrixsdk/api/MatrixAuth.java

File renamed without changes.

src/main/java/io/github/hikingc/matrixsdk/api/MatrixClient.java renamed to matrix-sdk-core/src/main/java/io/github/hikingc/matrixsdk/api/MatrixClient.java

File renamed without changes.

0 commit comments

Comments
 (0)