Merge ~vpa1977/ubuntu/+source/opencensus-java:ubuntu/devel into ubuntu/+source/opencensus-java:ubuntu/devel

Proposed by Vladimir Petko
Status: Merged
Merge reported by: Vladimir Petko
Merged at revision: a318702c937ca3fc39d5bdd7cdade40d631dadbc
Proposed branch: ~vpa1977/ubuntu/+source/opencensus-java:ubuntu/devel
Merge into: ubuntu/+source/opencensus-java:ubuntu/devel
Diff against target: 186 lines (+61/-15)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/fix-gradle-build.patch (+47/-14)
debian/rules (+4/-0)
Reviewer Review Type Date Requested Status
Canonical Foundations Team Pending
git-ubuntu import Pending
Review via email: mp+460651@code.launchpad.net

Description of the change

This MP resolves Java 21 ftbfs.

PPA: ppa:vpa1977/gettext [1]

Changes:
 - Use java_compat_level variable provided by java-common to adjust -source/-target level to the minimum required by the default Java

Testing:
 - rebuild in default Java 21 ppa[2]
 - piuparts test [3]

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext
[2] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext-21/+sourcepub/15792336/+listing-archive-extra
[3] https://bugs.launchpad.net/ubuntu/+source/opencensus-java/+bug/2053295/comments/1

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6bd2a9a..cb15500 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+opencensus-java (0.24.0+ds-1ubuntu1) noble; urgency=medium
7+
8+ [ Pushkar Kulkarni ]
9+ * d/rules, d/patches: Use java_compat_level to adjust -source/-target
10+ levels (LP: #2053295).
11+
12+ -- Vladimir Petko <vladimir.petko@canonical.com> Fri, 16 Feb 2024 15:32:43 +1300
13+
14 opencensus-java (0.24.0+ds-1) unstable; urgency=high
15
16 * Refresh packaging
17diff --git a/debian/control b/debian/control
18index e9bd2d1..bd27fbf 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: opencensus-java
23 Section: java
24 Priority: optional
25-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
28 Uploaders:
29 Olek Wojnar <olek@debian.org>,
30 Andreas Tille <tille@debian.org>
31diff --git a/debian/patches/fix-gradle-build.patch b/debian/patches/fix-gradle-build.patch
32index ead70c2..184491c 100644
33--- a/debian/patches/fix-gradle-build.patch
34+++ b/debian/patches/fix-gradle-build.patch
35@@ -32,7 +32,7 @@ Last-Update: 2020-06-15
36
37 apply plugin: "checkstyle"
38 apply plugin: 'maven'
39-@@ -38,17 +36,8 @@
40+@@ -38,24 +36,13 @@
41 apply plugin: 'java'
42 apply plugin: "signing"
43 apply plugin: "jacoco"
44@@ -50,7 +50,16 @@ Last-Update: 2020-06-15
45
46 group = "io.opencensus"
47 version = "0.24.0" // CURRENT_OPENCENSUS_VERSION
48-@@ -72,7 +61,7 @@
49+-
50+- sourceCompatibility = 1.7
51+- targetCompatibility = 1.7
52+-
53++ sourceCompatibility = "$System.env.JAVA_SOURCE_VERSION"
54++ targetCompatibility = "$System.env.JAVA_TARGET_VERSION"
55+ repositories {
56+ mavenCentral()
57+ mavenLocal()
58+@@ -72,7 +59,7 @@
59 }
60 }
61
62@@ -59,7 +68,31 @@ Last-Update: 2020-06-15
63 // We suppress the "try" warning because it disallows managing an auto-closeable with
64 // try-with-resources without referencing the auto-closeable within the try block.
65 // We suppress the "processing" warning as suggested in
66-@@ -155,7 +144,6 @@
67+@@ -123,14 +110,15 @@
68+ // TODO(sebright): Enable -Werror for Java 9 once we upgrade AutoValue (issue #1017).
69+ it.options.compilerArgs += ["-Werror"]
70+ }
71+- if (JavaVersion.current().isJava9()) {
72+- // TODO(sebright): Currently, building with Java 9 produces the following "options" warnings:
73+- //
74+- // :opencensus-api:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
75+- // warning: [options] source value 1.6 is obsolete and will be removed in a future release
76+- // warning: [options] target value 1.6 is obsolete and will be removed in a future release
77+- it.options.compilerArgs += ["-Xlint:-options"]
78+- }
79++ // TODO(sebright): Currently, building with Java 9 produces the following "options" warnings:
80++ //
81++ // :opencensus-api:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
82++ // warning: [options] source value 1.6 is obsolete and will be removed in a future release
83++ // warning: [options] target value 1.6 is obsolete and will be removed in a future release
84++ //
85++ // Using java-common's java_compat_level, we have the source/target values set to the current minimum
86++ // This results in deprecation warnings, which we might want to supress because -Werror
87++ it.options.compilerArgs += ["-Xlint:-options"]
88+ }
89+
90+ compileTestJava {
91+@@ -155,7 +143,6 @@
92 }
93
94 ext {
95@@ -67,7 +100,7 @@ Last-Update: 2020-06-15
96 aspectjVersion = '1.8.11'
97 autoValueVersion = '1.4'
98 findBugsAnnotationsVersion = '3.0.1'
99-@@ -185,9 +173,9 @@
100+@@ -185,9 +172,9 @@
101 httpcomponentsVersion = "4.5.8"
102
103 libraries = [
104@@ -78,7 +111,7 @@ Last-Update: 2020-06-15
105 auto_service: 'com.google.auto.service:auto-service:1.0-rc3',
106 byte_buddy: 'net.bytebuddy:byte-buddy:1.8.22',
107 config: 'com.typesafe:config:1.2.1',
108-@@ -304,12 +292,6 @@
109+@@ -304,12 +291,6 @@
110 html.enabled = true
111 }
112 }
113@@ -91,7 +124,7 @@ Last-Update: 2020-06-15
114
115 checkstyle {
116 configFile = file("$rootDir/buildscripts/checkstyle.xml")
117-@@ -321,22 +303,6 @@
118+@@ -321,22 +302,6 @@
119 configProperties["rootDir"] = rootDir
120 }
121
122@@ -114,7 +147,7 @@ Last-Update: 2020-06-15
123 signing {
124 required false
125 sign configurations.archives
126-@@ -356,29 +322,6 @@
127+@@ -356,29 +321,6 @@
128 archives javadocJar, sourcesJar
129 }
130
131@@ -144,7 +177,7 @@ Last-Update: 2020-06-15
132 uploadArchives {
133 repositories {
134 mavenDeployer {
135-@@ -433,7 +376,6 @@
136+@@ -433,7 +375,6 @@
137 uploadArchives.onlyIf {
138 name in ['opencensus-api',
139 'opencensus-contrib-agent',
140@@ -258,8 +291,8 @@ Last-Update: 2020-06-15
141 description = 'OpenCensus API'
142
143 +[compileJava, compileTestJava].each() {
144-+ it.sourceCompatibility = 1.8
145-+ it.targetCompatibility = 1.8
146++ it.sourceCompatibility = "$System.env.JAVA_SOURCE_VERSION"
147++ it.targetCompatibility = "$System.env.JAVA_TARGET_VERSION"
148 +}
149 +
150 dependencies {
151@@ -281,8 +314,8 @@ Last-Update: 2020-06-15
152 [compileJava, compileTestJava].each() {
153 - it.sourceCompatibility = 1.6
154 - it.targetCompatibility = 1.6
155-+ it.sourceCompatibility = 1.8
156-+ it.targetCompatibility = 1.8
157++ it.sourceCompatibility = "$System.env.JAVA_SOURCE_VERSION"
158++ it.targetCompatibility = "$System.env.JAVA_TARGET_VERSION"
159 }
160
161 dependencies {
162@@ -300,8 +333,8 @@ Last-Update: 2020-06-15
163 [compileJava, compileTestJava].each() {
164 - it.sourceCompatibility = 1.6
165 - it.targetCompatibility = 1.6
166-+ it.sourceCompatibility = 1.8
167-+ it.targetCompatibility = 1.8
168++ it.sourceCompatibility = "$System.env.JAVA_SOURCE_VERSION"
169++ it.targetCompatibility = "$System.env.JAVA_TARGET_VERSION"
170 }
171
172 dependencies {
173diff --git a/debian/rules b/debian/rules
174index 6a861bc..56533f3 100755
175--- a/debian/rules
176+++ b/debian/rules
177@@ -1,5 +1,9 @@
178 #!/usr/bin/make -f
179
180+include /usr/share/java/java_defaults.mk
181+export JAVA_SOURCE_VERSION = $(java_compat_level)
182+export JAVA_TARGET_VERSION = $(java_compat_level)
183+
184 # Ensure packages build with no Internet access
185 export http_proxy=127.0.0.1:9
186 export https_proxy=127.0.0.1:9

Subscribers

People subscribed via source and target branches