File tree Expand file tree Collapse file tree 2 files changed +43
-11
lines changed
grpc-common-spring-boot/src/main/java/net/devh/boot/grpc/common/util Expand file tree Collapse file tree 2 files changed +43
-11
lines changed Original file line number Diff line number Diff line change 72
72
buildRevision = versioning. info. commit
73
73
}
74
74
75
- task createVersionFile {
76
- new File (" ${ projectDir} /grpc-common-spring-boot/src/main/java/net/devh/boot/grpc/common/util/Versions.java" ). text = """
77
- package net.devh.boot.grpc.common.util;
78
- public final class Versions {
79
- public static final String PROJECT_VERSION = "v${ projectVersion} ";
80
- private Versions() {}
81
- }
82
- """
83
- }
84
-
85
75
clean. doFirst {
86
76
delete " ${ projectDir} /grpc-common-spring-boot/src/main/java/net/devh/boot/grpc/common/util/Versions.java"
87
77
}
@@ -150,7 +140,18 @@ allprojects {
150
140
}
151
141
}
152
142
153
- // Generate MANIFEST.MF
143
+ task createVersionsFile(type : Copy ) {
144
+ from(" src/main/java/net/devh/boot/grpc/common/util/Versions.java.template" ) {
145
+ rename " Versions.java.template" , " Versions.java"
146
+ }
147
+ into " src/main/java/net/devh/boot/grpc/common/util"
148
+ filter(org.apache.tools.ant.filters.ReplaceTokens , tokens : [
149
+ ' VERSIONS_STRING_PLACEHOLDER' : " v${ projectVersion} " . toString(),
150
+ ])
151
+ }
152
+ compileJava. dependsOn createVersionsFile
153
+
154
+ // Generate.MF
154
155
jar {
155
156
manifest {
156
157
attributes(
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2016-2023 The gRPC-Spring Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package net.devh.boot.grpc.common.util;
18
+
19
+ /**
20
+ * Class that contains version strings
21
+ */
22
+ public final class Versions {
23
+
24
+ /**
25
+ * A constant that defines, the current version of the library.
26
+ */
27
+ public static final String PROJECT_VERSION = "VERSIONS_STRING_PLACEHOLDER";
28
+
29
+ private Versions() {}
30
+
31
+ }
You can’t perform that action at this time.
0 commit comments