Skip to content

Commit 07ee427

Browse files
authored
[JAVA_API] Adjust Java sample build scripts for Gradle 8+ mainClass handling (#1009)
Replace deprecated (version 7) and later removed (version 8) `mainClassName` option with the `application { mainClass = <class_name> }` in the `hello_query_device` and `face_detection samples` so they build with newer Gradle versions
1 parent 7573762 commit 07ee427

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

modules/java_api/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
build_benchmark_app=false
21
build_java_samples=false
32
build_kotlin_samples=false
43
build_hello_query_device=false

modules/java_api/samples/face_detection_java_sample/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ sourceSets {
3535
}
3636
}
3737
}
38-
mainClassName = 'Main'
38+
39+
application {
40+
mainClass = 'Main'
41+
}
3942

4043
dependencies {
4144
implementation rootProject

modules/java_api/samples/face_detection_kotlin_sample/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ sourceSets {
4040
main.java.srcDirs = ['src/main/kotlin', '../common']
4141
main.kotlin.srcDirs = ['src/main/kotlin', '../common']
4242
}
43-
mainClassName = 'Main'
43+
44+
application {
45+
mainClass = 'Main'
46+
}
4447

4548
dependencies {
4649
implementation rootProject

modules/java_api/samples/hello_query_device/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ sourceSets {
1010
}
1111
}
1212
}
13-
mainClassName = 'Main'
13+
14+
application {
15+
mainClass = 'Main'
16+
}
1417

1518
dependencies {
1619
implementation rootProject

modules/java_api/settings.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
rootProject.name = 'openvino'
22

3-
if (build_benchmark_app.toBoolean()) {
4-
include 'samples:benchmark_app'
5-
}
63
if (build_java_samples.toBoolean()) {
7-
include 'samples:face_detection_java_sample', 'samples:face_detection_sample_async'
4+
include 'samples:face_detection_java_sample'
85
}
96
if (build_kotlin_samples.toBoolean()) {
107
include 'samples:face_detection_kotlin_sample'

0 commit comments

Comments
 (0)