Skip to content

Commit fb2bdf4

Browse files
authored
Divide project into submodules: jdk + basics (#24)
1 parent 0f08b44 commit fb2bdf4

Some content is hidden

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

54 files changed

+104
-57
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
if: always()
4848
with:
4949
files: |
50-
build/test-results/test/*.xml
50+
jdk/build/test-results/test/*.xml
51+
basics/build/test-results/test/*.xml
5152
5253
- name: Set badge color
5354
shell: bash

README.md

Lines changed: 4 additions & 29 deletions

basics/README.md

Lines changed: 5 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package pl.mperor.lab.java;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
System.out.println("Hello Java Basics module.");
6+
}
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package pl.mperor.lab.java;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
public class JavaBasics {
6+
7+
@Test
8+
public void testTypesOfComments() {
9+
// Single line comment
10+
/*
11+
Multi
12+
line
13+
comment
14+
*/
15+
/**
16+
* JavaDoc
17+
*/
18+
/// Markdown JavaDoc (Since JDK 23)
19+
}
20+
21+
}

build.gradle

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
group = 'pl.mperor.lab.java'
62
version = '1.0-SNAPSHOT'
73

8-
repositories {
9-
mavenCentral()
10-
}
4+
subprojects {
5+
apply plugin: 'java'
6+
7+
group = rootProject.group
8+
version = rootProject.version
119

12-
ext {
13-
graaljsVersion = '24.1.1'
14-
}
10+
dependencies {
11+
testImplementation platform('org.junit:junit-bom:5.11.3')
12+
testImplementation 'org.junit.jupiter:junit-jupiter'
13+
}
1514

16-
dependencies {
17-
testImplementation platform('org.junit:junit-bom:5.11.3')
18-
testImplementation 'org.junit.jupiter:junit-jupiter'
19-
testRuntimeOnly 'com.h2database:h2:2.2.224'
20-
testRuntimeOnly "org.graalvm.js:js:${graaljsVersion}"
21-
testImplementation "org.graalvm.js:js-scriptengine:${graaljsVersion}"
22-
}
15+
test {
16+
useJUnitPlatform()
17+
}
2318

24-
test {
25-
useJUnitPlatform()
26-
}
19+
repositories {
20+
mavenCentral()
21+
}
2722

28-
tasks.withType(JavaCompile) {
29-
options.encoding = 'UTF-8'
30-
}
23+
tasks.withType(JavaCompile) {
24+
options.encoding = 'UTF-8'
25+
}
3126

32-
tasks.withType(Test) {
33-
jvmArgs("-Dfile.encoding=UTF-8")
27+
tasks.withType(Test) {
28+
jvmArgs("-Dfile.encoding=UTF-8")
29+
}
3430
}

jdk/README.md

Lines changed: 31 additions & 0 deletions

jdk/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ext {
2+
graaljsVersion = '24.1.1'
3+
}
4+
5+
dependencies {
6+
testRuntimeOnly 'com.h2database:h2:2.2.224'
7+
testRuntimeOnly "org.graalvm.js:js:${graaljsVersion}"
8+
testImplementation "org.graalvm.js:js-scriptengine:${graaljsVersion}"
9+
}
10+
File renamed without changes.

src/main/java/pl/mperor/lab/java/Main.java renamed to jdk/src/main/java/pl/mperor/lab/java/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class Main {
66

77
public static void main(String[] args) {
8-
System.out.println("Hello World!");
8+
System.out.println("Hello JDK features module!");
99
SwingUtilities.invokeLater(SwingForm::new);
1010
}
1111

0 commit comments

Comments
 (0)