-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support optional booleans in annotation processor
- Loading branch information
1 parent
8041ddf
commit b0a23ce
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...ion-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1713Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package picocli.annotation.processing.tests; | ||
|
||
import com.google.testing.compile.Compilation; | ||
import com.google.testing.compile.JavaFileObjects; | ||
import org.junit.Test; | ||
|
||
import javax.annotation.processing.Processor; | ||
|
||
import static com.google.testing.compile.CompilationSubject.assertThat; | ||
import static com.google.testing.compile.Compiler.javac; | ||
|
||
public class Issue1713Test | ||
{ | ||
//@Ignore("https://github.com/remkop/picocli/issues/1713") | ||
@Test | ||
public void testIssue1713() { | ||
Processor processor = new AnnotatedCommandSourceGeneratorProcessor(); | ||
Compilation compilation = | ||
javac() | ||
.withProcessors(processor) | ||
.compile(JavaFileObjects.forResource( | ||
"picocli/issue1713/Command.java")); | ||
|
||
assertThat(compilation).succeeded(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
picocli-annotation-processing-tests/src/test/resources/picocli/issue1713/Command.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package picocli.issue1713; | ||
|
||
import java.util.Optional; | ||
|
||
import picocli.CommandLine; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Model.CommandSpec; | ||
import picocli.CommandLine.Spec; | ||
|
||
@Command(name = "Command", | ||
description = "Command description") | ||
class Command1 { | ||
|
||
@Spec | ||
CommandSpec spec; | ||
|
||
@CommandLine.Option(names = "--progress", | ||
description = "A negatable optional boolean should be allowed", | ||
negatable = true) | ||
Optional<Boolean> progress; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters