Skip to content

Commit c8b37e8

Browse files
authored
Update (google#762)
* put LICENSE file into .jar * fix typo * add clarification comment in PY wrapper
1 parent 40f0fdc commit c8b37e8

File tree

8 files changed

+52
-10
lines changed

8 files changed

+52
-10
lines changed

c/tools/brotli.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static Command ParseParams(Context* params) {
263263
return COMMAND_HELP;
264264
} else if (c == 'j' || c == 'k') {
265265
if (keep_set) {
266-
fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
266+
fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
267267
return COMMAND_INVALID;
268268
}
269269
keep_set = BROTLI_TRUE;
@@ -388,7 +388,7 @@ static Command ParseParams(Context* params) {
388388
return COMMAND_HELP;
389389
} else if (strcmp("keep", arg) == 0) {
390390
if (keep_set) {
391-
fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
391+
fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
392392
return COMMAND_INVALID;
393393
}
394394
keep_set = BROTLI_TRUE;
@@ -401,7 +401,7 @@ static Command ParseParams(Context* params) {
401401
params->copy_stat = BROTLI_FALSE;
402402
} else if (strcmp("rm", arg) == 0) {
403403
if (keep_set) {
404-
fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
404+
fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
405405
return COMMAND_INVALID;
406406
}
407407
keep_set = BROTLI_TRUE;

java/BUILD

+12
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ cc_library(
3636

3737
# <<< JNI headers
3838

39+
genrule(
40+
name = "license_resource",
41+
srcs = ["@org_brotli//:LICENSE"],
42+
outs = ["META-INF/LICENSE"],
43+
cmd = "cp -f $< $@",
44+
)
45+
46+
java_library(
47+
name = "license",
48+
resources = [":license_resource"],
49+
)
50+
3951
########################################################
4052
# WARNING: do not (transitively) depend on this target!
4153
########################################################

java/org/brotli/dec/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ java_library(
1717
exclude = ["*Test*.java"],
1818
),
1919
proguard_specs = ["proguard.pgcfg"],
20+
resource_jars = ["//:license"],
2021
)
2122

2223
load(":build_defs.bzl", "brotli_java_test")

java/org/brotli/dec/pom.xml

+25
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,31 @@
133133
</archive>
134134
</configuration>
135135
</plugin>
136+
<plugin>
137+
<artifactId>maven-resources-plugin</artifactId>
138+
<version>3.1.0</version>
139+
<executions>
140+
<execution>
141+
<id>copy-license</id>
142+
<phase>validate</phase>
143+
<goals>
144+
<goal>copy-resources</goal>
145+
</goals>
146+
<configuration>
147+
<outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
148+
<resources>
149+
<resource>
150+
<directory>../../../../</directory>
151+
<includes>
152+
<include>LICENSE</include>
153+
</includes>
154+
<filtering>false</filtering>
155+
</resource>
156+
</resources>
157+
</configuration>
158+
</execution>
159+
</executions>
160+
</plugin>
136161
</plugins>
137162
</build>
138163

java/org/brotli/wrapper/common/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ java_library(
1818
["*.java"],
1919
exclude = ["*Test*.java"],
2020
),
21+
resource_jars = ["//:license"],
2122
)
2223

2324
java_library(

java/org/brotli/wrapper/dec/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ java_library(
1313
["*.java"],
1414
exclude = ["*Test*.java"],
1515
),
16+
resource_jars = ["//:license"],
1617
)
1718

1819
java_library(

java/org/brotli/wrapper/enc/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ java_library(
1818
["*.java"],
1919
exclude = ["*Test*.java"],
2020
),
21+
resource_jars = ["//:license"],
2122
)
2223

2324
java_library(

python/_brotli.cc

+8-7
Original file line numberDiff line numberDiff line change
@@ -703,13 +703,14 @@ PyDoc_STRVAR(brotli_doc, "Implementation module for the Brotli library.");
703703

704704
static struct PyModuleDef brotli_module = {
705705
PyModuleDef_HEAD_INIT,
706-
"_brotli",
707-
brotli_doc,
708-
0,
709-
brotli_methods,
710-
NULL,
711-
NULL,
712-
NULL
706+
"_brotli", /* m_name */
707+
brotli_doc, /* m_doc */
708+
0, /* m_size */
709+
brotli_methods, /* m_methods */
710+
NULL, /* m_reload */
711+
NULL, /* m_traverse */
712+
NULL, /* m_clear */
713+
NULL /* m_free */
713714
};
714715
#else
715716
#define INIT_BROTLI init_brotli

0 commit comments

Comments
 (0)