diff --git a/build.gradle b/build.gradle index 91ff826..0102b40 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group = 'com.github.holgerbrandl' -version = '1.3' +version = '1.4' buildscript { ext.kotlin_version = '1.1.60' @@ -52,4 +52,4 @@ publishing { artifactId = 'kscript-annotations' } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/ScriptDirectives.kt b/src/main/kotlin/ScriptDirectives.kt index 9df5b73..2f0c426 100644 --- a/src/main/kotlin/ScriptDirectives.kt +++ b/src/main/kotlin/ScriptDirectives.kt @@ -27,6 +27,13 @@ annotation class Include(val includePath: String) annotation class KotlinOpts(val runOptions: String) +@Target(AnnotationTarget.FILE) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +@Repeatable +annotation class CompilerOpts(val kotlincFlags: String) + + // MavenRepository and DependsOnMaven are supported "as it" for compatibility with jupyter notebooks. // see https://github.com/kohesive/keplin/blob/master/keplin-maven-resolver/src/main/kotlin/uy/kohesive/keplin/kotlin/script/resolver/maven/MavenResolverAnnotations.kt // example https://github.com/kohesive/keplin/blob/a307e05eae091c99c665fe3da52a428fb0e10a6a/keplin-maven-resolver/src/test/kotlin/uy/kohesive/keplin/kotlin/script/resolver/maven/TestMavenScriptDependencies.kt#L38 @@ -38,13 +45,6 @@ annotation class KotlinOpts(val runOptions: String) @Repeatable annotation class DependsOnMaven(val artifactLocator: String) -@Target(AnnotationTarget.FILE) -@Retention(AnnotationRetention.SOURCE) -@Repeatable -// in contrast to the original version we make the id mandatory here. -// This keeps ensures compatiblity with keplin but eases parsing -//annotation class MavenRepository(val id: String = "", val url: String) - /** * Declare a maven repository that will be used by kscript to resolve dependencies * @@ -53,4 +53,7 @@ annotation class DependsOnMaven(val artifactLocator: String) * @param user Optional user name * @param password Optional password (required if user is defined) */ +@Target(AnnotationTarget.FILE) +@Retention(AnnotationRetention.SOURCE) +@Repeatable annotation class MavenRepository(val id: String, val url: String, val user: String = "", val password: String = "")