-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't suggest removing runtime-required annotation libraries.
Resolves issue 1290
- Loading branch information
1 parent
9c4739f
commit 0d94d93
Showing
4 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
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
67 changes: 67 additions & 0 deletions
67
...ionalTest/groovy/com/autonomousapps/jvm/projects/AnnotationsImplementationProject2.groovy
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,67 @@ | ||
package com.autonomousapps.jvm.projects | ||
|
||
import com.autonomousapps.AbstractProject | ||
import com.autonomousapps.kit.GradleProject | ||
import com.autonomousapps.kit.Source | ||
import com.autonomousapps.kit.gradle.Java | ||
import com.autonomousapps.model.ProjectAdvice | ||
|
||
import static com.autonomousapps.AdviceHelper.actualProjectAdvice | ||
import static com.autonomousapps.AdviceHelper.emptyProjectAdviceFor | ||
import static com.autonomousapps.kit.gradle.Dependency.implementation | ||
|
||
final class AnnotationsImplementationProject2 extends AbstractProject { | ||
|
||
final GradleProject gradleProject | ||
|
||
AnnotationsImplementationProject2() { | ||
this.gradleProject = build() | ||
} | ||
|
||
private GradleProject build() { | ||
return newGradleProjectBuilder() | ||
.withSubproject('consumer') { s -> | ||
s.sources = SOURCE_CONSUMER | ||
s.withBuildScript { bs -> | ||
bs.plugins = javaLibrary | ||
bs.dependencies( | ||
implementation('org.cthing:cthing-annotations:1.0.0'), | ||
) | ||
|
||
// "cthing" uses Java 17+ | ||
bs.java = Java.of(17) | ||
} | ||
} | ||
.write() | ||
} | ||
|
||
private static final List<Source> SOURCE_CONSUMER = [ | ||
Source.java( | ||
'''\ | ||
@PackageNonnullByDefault | ||
package com.example.consumer; | ||
import org.cthing.annotations.PackageNonnullByDefault; | ||
''' | ||
) | ||
.withPath('com.example.consumer', 'package-info') | ||
.build(), | ||
Source.java( | ||
'''\ | ||
package com.example.consumer; | ||
public class Consumer {} | ||
''' | ||
) | ||
.withPath('com.example.consumer', 'Consumer') | ||
.build() | ||
] | ||
|
||
Set<ProjectAdvice> actualBuildHealth() { | ||
return actualProjectAdvice(gradleProject) | ||
} | ||
|
||
final Set<ProjectAdvice> expectedBuildHealth = [ | ||
emptyProjectAdviceFor(':consumer'), | ||
] | ||
} |
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
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