File tree 6 files changed +49
-20
lines changed
jbbp/src/main/java/com/igormaznitsa/jbbp
src/main/java/com/igormaznitsa/jbbp/plugin/gradle
jbbp-maven/jbbp-maven-plugin/src/main/java/com/igormaznitsa/jbbp/plugin/mvn
6 files changed +49
-20
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,13 @@ buildscript {
47
47
}
48
48
}
49
49
50
+ tasks. withType(JavaCompile ) {
51
+ options. compilerArgs << " -Xlint:deprecation"
52
+ }
53
+
50
54
task sourcesJar (type : Jar ) {
51
55
duplicatesStrategy = ' include'
52
- classifier = ' sources'
56
+ archiveClassifier = ' sources'
53
57
from sourceSets. main. allSource
54
58
}
55
59
@@ -63,20 +67,16 @@ sourceSets {
63
67
}
64
68
}
65
69
66
- pluginBundle {
70
+ gradlePlugin {
67
71
website = ' https://github.com/raydac/java-binary-block-parser'
68
72
vcsUrl = ' https://github.com/raydac/java-binary-block-parser'
69
- description = ' The plug-in processes JBBP scripts and generate Java classes from them'
70
- tags = [' jbbp' , ' converter' ]
71
- }
72
-
73
- gradlePlugin {
74
73
plugins {
75
74
jbbpPlugin {
76
75
id = ' com.igormaznitsa.gradle.jbbp'
77
76
displayName = ' JBBP Sources Generator plugin'
78
77
implementationClass = ' com.igormaznitsa.jbbp.plugin.gradle.JBBPPlugin'
79
78
description = ' The plug-in processes JBBP scripts and generate Java classes from them'
79
+ tags = [' jbbp' , ' converter' ]
80
80
}
81
81
}
82
82
}
Original file line number Diff line number Diff line change 24
24
<properties >
25
25
<maven .compiler.source>1.8</maven .compiler.source>
26
26
<maven .compiler.target>1.8</maven .compiler.target>
27
- <gradle .executable>gradle </gradle .executable>
27
+ <gradle .executable>gradle8 </gradle .executable>
28
28
<gradleGoal >publishToMavenLocal</gradleGoal >
29
29
</properties >
30
30
Original file line number Diff line number Diff line change 2
2
3
3
import static com .igormaznitsa .jbbp .utils .JBBPUtils .ARRAY_STRING_EMPTY ;
4
4
5
-
6
5
import com .igormaznitsa .jbbp .JBBPCustomFieldTypeProcessor ;
7
6
import com .igormaznitsa .jbbp .compiler .JBBPNamedFieldInfo ;
8
7
import com .igormaznitsa .jbbp .compiler .tokenizer .JBBPFieldTypeParameterContainer ;
8
+ import com .igormaznitsa .jbbp .io .JBBPArraySizeLimiter ;
9
9
import com .igormaznitsa .jbbp .io .JBBPBitInputStream ;
10
10
import com .igormaznitsa .jbbp .io .JBBPBitOrder ;
11
11
import com .igormaznitsa .jbbp .model .JBBPAbstractField ;
27
27
import org .gradle .api .plugins .JavaPlugin ;
28
28
import org .gradle .api .plugins .JavaPluginConvention ;
29
29
import org .gradle .api .tasks .Input ;
30
- import org .gradle .api .tasks .Optional ;
31
30
import org .gradle .api .tasks .SourceSet ;
32
31
33
32
/**
@@ -94,7 +93,9 @@ public JBBPAbstractField readCustomFieldType(@Nonnull final JBBPBitInputStream i
94
93
@ Nullable final JBBPNamedFieldInfo fieldName ,
95
94
final int extraData ,
96
95
final boolean readWholeStream ,
97
- final int arrayLength ) throws IOException {
96
+ final int arrayLength ,
97
+ final JBBPArraySizeLimiter arraySizeLimiter )
98
+ throws IOException {
98
99
throw new Error ("Must not be called" );
99
100
}
100
101
};
Original file line number Diff line number Diff line change 19
19
import static com .igormaznitsa .jbbp .plugin .common .utils .CommonUtils .ensureEncodingName ;
20
20
import static com .igormaznitsa .jbbp .utils .JBBPUtils .ARRAY_STRING_EMPTY ;
21
21
22
-
23
22
import com .igormaznitsa .jbbp .JBBPCustomFieldTypeProcessor ;
24
23
import com .igormaznitsa .jbbp .compiler .JBBPNamedFieldInfo ;
25
24
import com .igormaznitsa .jbbp .compiler .tokenizer .JBBPFieldTypeParameterContainer ;
25
+ import com .igormaznitsa .jbbp .io .JBBPArraySizeLimiter ;
26
26
import com .igormaznitsa .jbbp .io .JBBPBitInputStream ;
27
27
import com .igormaznitsa .jbbp .io .JBBPBitOrder ;
28
28
import com .igormaznitsa .jbbp .mapper .Bin ;
@@ -380,7 +380,10 @@ public JBBPAbstractField readCustomFieldType(@Nonnull final JBBPBitInputStream i
380
380
@ Nullable final JBBPNamedFieldInfo fieldName ,
381
381
final int extraData ,
382
382
final boolean readWholeStream ,
383
- final int arrayLength ) throws IOException {
383
+ final int arrayLength ,
384
+ @ Nonnull
385
+ final JBBPArraySizeLimiter arraySizeLimiter )
386
+ throws IOException {
384
387
throw new Error ("Must not be called" );
385
388
}
386
389
};
Original file line number Diff line number Diff line change 72
72
import java .util .Collections ;
73
73
import java .util .List ;
74
74
import java .util .Map ;
75
- import java .util .Objects ;
76
75
import java .util .Properties ;
77
76
78
77
/**
@@ -277,15 +276,18 @@ public JBBPParserExpressionArraySizeController getExpressionArraySizeController(
277
276
/**
278
277
* Set current registered instance of controller to check array size calculated by expression.
279
278
*
280
- * @param arraySizeObserver instance of array size observer, must not be null.
279
+ * @param arraySizeController instance of array size observer, must not be null.
281
280
* @return instance of the parser.
282
281
* @throws NullPointerException if argument is null
283
282
* @see #DEFAULT_EXPRESSION_ARRAY_SIZE_CONTROLLER
284
283
* @since 2.1.0
285
284
*/
286
285
public JBBPParser setExpressionArraySizeController (
287
- final JBBPParserExpressionArraySizeController arraySizeObserver ) {
288
- this .expressionArraySizeController = Objects .requireNonNull (arraySizeObserver );
286
+ final JBBPParserExpressionArraySizeController arraySizeController ) {
287
+ if (arraySizeController == null ) {
288
+ throw new NullPointerException ("Controller value must not be null" );
289
+ }
290
+ this .expressionArraySizeController = arraySizeController ;
289
291
return this ;
290
292
}
291
293
Original file line number Diff line number Diff line change 256
256
<configuration >
257
257
<failFast >true</failFast >
258
258
<rules >
259
- <dependencyConvergence />
260
- <banDuplicateClasses />
259
+ <dependencyConvergence >
260
+ <excludedScopes >
261
+ <scope >test</scope >
262
+ <scope >provided</scope >
263
+ <scope >runtime</scope >
264
+ </excludedScopes >
265
+ <excludes >
266
+ <exclude >org.codehaus.*</exclude >
267
+ <exclude >org.apache.maven.*</exclude >
268
+ </excludes >
269
+ </dependencyConvergence >
270
+ <banDuplicateClasses >
271
+ <ignoreClasses >
272
+ <ignoreClass >com.plexus.*</ignoreClass >
273
+ <ignoreClass >javax.*</ignoreClass >
274
+ <ignoreClass >org.codehaus.*</ignoreClass >
275
+ </ignoreClasses >
276
+ <ignoredScopes >
277
+ <ignoredScope >test</ignoredScope >
278
+ <ignoredScope >provided</ignoredScope >
279
+ </ignoredScopes >
280
+ <ignoreWhenIdentical >true</ignoreWhenIdentical >
281
+ <findAllDuplicates >true</findAllDuplicates >
282
+ </banDuplicateClasses >
261
283
<banCircularDependencies />
262
284
<enforceBytecodeVersion >
263
285
<maxJdkVersion >${maven.compiler.target} </maxJdkVersion >
264
286
<ignoredScopes >
265
287
<ignoredScope >test</ignoredScope >
288
+ <ignoredScope >provided</ignoredScope >
266
289
</ignoredScopes >
267
290
</enforceBytecodeVersion >
268
291
</rules >
271
294
<dependency >
272
295
<groupId >org.codehaus.mojo</groupId >
273
296
<artifactId >extra-enforcer-rules</artifactId >
274
- <version >1.7 .0</version >
297
+ <version >1.8 .0</version >
275
298
</dependency >
276
299
</dependencies >
277
300
</plugin >
You can’t perform that action at this time.
0 commit comments