Skip to content

Commit 999511a

Browse files
authored
Merge pull request #5692 from kwvanderlinde/refactor/3777-protobuf
Move protobuf messages into a separate subproject
2 parents 7a1b5c6 + 3cab052 commit 999511a

File tree

10 files changed

+39
-18
lines changed

10 files changed

+39
-18
lines changed

build.gradle

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ plugins {
1818
alias(libs.plugins.git.version)
1919
alias(libs.plugins.javafx)
2020
alias(libs.plugins.jpackage.runtime)
21-
alias(libs.plugins.protobuf)
2221
alias(libs.plugins.shadow)
2322

2423
alias(libs.plugins.spotless) apply false
@@ -137,21 +136,6 @@ javafx {
137136
modules = ['javafx.base', 'javafx.controls', 'javafx.media', 'javafx.swing', 'javafx.web', 'javafx.fxml', 'javafx.graphics']
138137
}
139138

140-
protobuf {
141-
protoc {
142-
artifact = libs.protobuf.protoc.get()
143-
}
144-
}
145-
146-
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
147-
sourceSets {
148-
main {
149-
java {
150-
srcDirs 'build/generated/sources/proto/main/java'
151-
}
152-
}
153-
}
154-
155139
run {
156140
args = ['-v=' + appSemVer]
157141
// Add -Dlog4j2.debug to see log4j2 details
@@ -363,6 +347,7 @@ def zipJpackageImage = tasks.register('zipJpackageImage', Zip) {
363347
dependencies {
364348
implementation project(':common')
365349
implementation project(':clientserver')
350+
implementation project(':messages')
366351

367352
implementation(libs.bundles.log4j)
368353
implementation(libs.slf4j.simple)
@@ -372,7 +357,6 @@ dependencies {
372357
implementation(libs.servicediscovery)
373358
implementation(libs.upnplib)
374359
implementation(libs.okhttp)
375-
implementation(libs.protobuf.java)
376360

377361
implementation(libs.bundles.imageio)
378362
implementation(libs.batik)

messages/build.gradle

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
buildscript {
2+
dependencies {
3+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
4+
}
5+
}
6+
7+
8+
plugins {
9+
id "base"
10+
id "java-library"
11+
12+
alias(libs.plugins.protobuf)
13+
}
14+
15+
apply from: rootProject.file('buildSrc/shared.gradle')
16+
17+
// In this section you declare the dependencies for your production and test code
18+
dependencies {
19+
// Must be `api` so all consumers can access protobuf types.
20+
api(libs.protobuf.java)
21+
}
22+
23+
24+
protobuf {
25+
protoc {
26+
artifact = libs.protobuf.protoc.get()
27+
}
28+
}
29+
30+
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
31+
sourceSets {
32+
main {
33+
java {
34+
srcDirs layout.buildDirectory.dir('generated/sources/proto/main/java')
35+
}
36+
}
37+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ include 'services:webservice'
1616
*/
1717

1818
rootProject.name = 'MapTool'
19-
include 'common', ':clientserver'
19+
include 'common', 'messages', ':clientserver'

0 commit comments

Comments
 (0)