-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...ion-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1440Test.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,28 @@ | ||
package picocli.annotation.processing.tests; | ||
|
||
import com.google.testing.compile.Compilation; | ||
import com.google.testing.compile.JavaFileObjects; | ||
import org.junit.Ignore; | ||
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 Issue1440Test { | ||
@Ignore("https://github.com/remkop/picocli/issues/1440") | ||
@Test | ||
public void testIssue1440() { | ||
Processor processor = new AnnotatedCommandSourceGeneratorProcessor(); | ||
Compilation compilation = | ||
javac() | ||
.withProcessors(processor) | ||
.compile(JavaFileObjects.forResource( | ||
"picocli/issue1440inheritedoptions/Command1.java"), | ||
JavaFileObjects.forResource( | ||
"picocli/issue1440inheritedoptions/Command2.java")); | ||
|
||
assertThat(compilation).succeeded(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ation-processing-tests/src/test/resources/picocli/issue1440inheritedoptions/Command1.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,19 @@ | ||
package picocli.issue1440inheritedoptions; | ||
|
||
import picocli.CommandLine; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Model.CommandSpec; | ||
import picocli.CommandLine.Spec; | ||
|
||
@Command(name = "Command1", subcommands = CommandLine.HelpCommand.class, | ||
description = "Command 1 description") | ||
class Command1 { | ||
|
||
@Spec | ||
CommandSpec spec; | ||
|
||
@CommandLine.Option(names = "--option", | ||
scope = CommandLine.ScopeType.INHERIT, | ||
description = "If set to true, will not ask questions and configurations, e.g. to overwrite a file. We don't recommend setting this option to true unless you are working in a scripted environment") | ||
String option = ""; | ||
} |
18 changes: 18 additions & 0 deletions
18
...ation-processing-tests/src/test/resources/picocli/issue1440inheritedoptions/Command2.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,18 @@ | ||
package picocli.issue1440inheritedoptions; | ||
|
||
import picocli.CommandLine; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Model.CommandSpec; | ||
import picocli.CommandLine.Spec; | ||
|
||
@Command(name = "Command1", subcommands = CommandLine.HelpCommand.class, | ||
description = "Command 1 description") | ||
class Command2 { | ||
@Spec | ||
CommandSpec spec; | ||
|
||
@CommandLine.Option(names = "--option", | ||
scope = CommandLine.ScopeType.INHERIT, | ||
description = "If set to true, will not ask questions and configurations, e.g. to overwrite a file. We don't recommend setting this option to true unless you are working in a scripted environment") | ||
String option = ""; | ||
} |