forked from Pante/elementary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/PanteGH-147' into personal
- Loading branch information
Showing
7 changed files
with
687 additions
and
39 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
56 changes: 56 additions & 0 deletions
56
elementary/src/main/java/com/karuslabs/elementary/junit/annotations/Module.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,56 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2022 Karus Labs. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.karuslabs.elementary.junit.annotations; | ||
|
||
import com.karuslabs.elementary.junit.JavacExtension; | ||
import java.lang.annotation.*; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* Represents the javac --module (or -m) and --module-source-path option to use during compilation. | ||
* | ||
* @see <a href = "https://docs.oracle.com/en/java/javase/11/tools/javac.html">javac flags</a> | ||
*/ | ||
@Usage({JavacExtension.class}) | ||
@Documented | ||
@Retention(RUNTIME) | ||
@Target({TYPE, METHOD}) | ||
public @interface Module { | ||
|
||
/** | ||
* Module name. | ||
* | ||
* @return the module name | ||
*/ | ||
String value(); | ||
|
||
/** | ||
* Module source path. This path is relative to the <code><module_root>/src/test/resources</code> base path. | ||
* | ||
* @return the module source path | ||
*/ | ||
String sourcePath() default ""; | ||
} |
63 changes: 63 additions & 0 deletions
63
elementary/src/main/java/com/karuslabs/elementary/junit/annotations/ModulePath.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,63 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2022 Karus Labs. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.karuslabs.elementary.junit.annotations; | ||
|
||
import com.karuslabs.elementary.junit.JavacExtension; | ||
import java.lang.annotation.*; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* Represents the javac --module-path (or -p) option to use during compilation. | ||
* | ||
* @see <a href = "https://docs.oracle.com/en/java/javase/11/tools/javac.html">javac flags</a> | ||
*/ | ||
@Usage({JavacExtension.class}) | ||
@Documented | ||
@Retention(RUNTIME) | ||
@Target({TYPE, METHOD}) | ||
@Repeatable(ModulePaths.class) | ||
public @interface ModulePath { | ||
|
||
/** | ||
* Module artifact in the format <code>"<groupId>:<artifactId>:<version>"</code>. | ||
* | ||
* @return the module artifact | ||
*/ | ||
String value(); | ||
|
||
/** | ||
* The repository from where to get the artifact. | ||
* | ||
* @return the source repository | ||
*/ | ||
String repository() default Repository.LOCAL; | ||
|
||
class Repository { | ||
public static final String LOCAL = "${USERPROFILE}${HOME}/.m2/repository"; | ||
public static final String REPO1 = "https://repo1.maven.org/maven2/"; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
elementary/src/main/java/com/karuslabs/elementary/junit/annotations/ModulePaths.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,49 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2021 Karus Labs. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.karuslabs.elementary.junit.annotations; | ||
|
||
import com.karuslabs.elementary.junit.JavacExtension; | ||
|
||
import java.lang.annotation.*; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* A container type for {@link ModulePath}. | ||
*/ | ||
@Usage({JavacExtension.class}) | ||
@Documented | ||
@Retention(RUNTIME) | ||
@Target({TYPE, METHOD}) | ||
public @interface ModulePaths { | ||
|
||
/** | ||
* The contained {@code @ModulePath} annotations. | ||
* | ||
* @return the {@code @ModulePath} annotations | ||
*/ | ||
ModulePath[] value(); | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
elementary/src/main/java/com/karuslabs/elementary/junit/annotations/ProcessorPath.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,68 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2022 Karus Labs. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.karuslabs.elementary.junit.annotations; | ||
|
||
import com.karuslabs.elementary.junit.JavacExtension; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Repeatable; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* Represents the javac --processor-path (or -processorpath) option to use during compilation. | ||
* | ||
* @see <a href = "https://docs.oracle.com/en/java/javase/11/tools/javac.html">javac flags</a> | ||
*/ | ||
@Usage({JavacExtension.class}) | ||
@Documented | ||
@Retention(RUNTIME) | ||
@Target({TYPE, METHOD}) | ||
@Repeatable(ProcessorPaths.class) | ||
public @interface ProcessorPath { | ||
|
||
/** | ||
* Processor dependency artifact in the format <code>"<groupId>:<artifactId>:<version>"</code>. | ||
* | ||
* @return the processor dependency artifact | ||
*/ | ||
String value(); | ||
|
||
/** | ||
* The repository from where to get the artifact. | ||
* | ||
* @return the source repository | ||
*/ | ||
String repository() default Repository.LOCAL; | ||
|
||
class Repository { | ||
public static final String LOCAL = "${USERPROFILE}${HOME}/.m2/repository"; | ||
public static final String REPO1 = "https://repo1.maven.org/maven2/"; | ||
} | ||
|
||
} |
Oops, something went wrong.