Skip to content

Commit e0e8d2f

Browse files
authored
Merge pull request #2 from meonlol/feature/readd_compiler_opts
Re-add @file:CompilerOpts annotation from 1.2 + bump to 1.4
2 parents 412f221 + ab803f6 commit e0e8d2f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group = 'com.github.holgerbrandl'
2-
version = '1.3'
2+
version = '1.4'
33

44
buildscript {
55
ext.kotlin_version = '1.1.60'
@@ -52,4 +52,4 @@ publishing {
5252
artifactId = 'kscript-annotations'
5353
}
5454
}
55-
}
55+
}

src/main/kotlin/ScriptDirectives.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ annotation class Include(val includePath: String)
2727
annotation class KotlinOpts(val runOptions: String)
2828

2929

30+
@Target(AnnotationTarget.FILE)
31+
@Retention(AnnotationRetention.SOURCE)
32+
@MustBeDocumented
33+
@Repeatable
34+
annotation class CompilerOpts(val kotlincFlags: String)
35+
36+
3037
// MavenRepository and DependsOnMaven are supported "as it" for compatibility with jupyter notebooks.
3138
// see https://github.com/kohesive/keplin/blob/master/keplin-maven-resolver/src/main/kotlin/uy/kohesive/keplin/kotlin/script/resolver/maven/MavenResolverAnnotations.kt
3239
// 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)
3845
@Repeatable
3946
annotation class DependsOnMaven(val artifactLocator: String)
4047

41-
@Target(AnnotationTarget.FILE)
42-
@Retention(AnnotationRetention.SOURCE)
43-
@Repeatable
44-
// in contrast to the original version we make the id mandatory here.
45-
// This keeps ensures compatiblity with keplin but eases parsing
46-
//annotation class MavenRepository(val id: String = "", val url: String)
47-
4848
/**
4949
* Declare a maven repository that will be used by kscript to resolve dependencies
5050
*
@@ -53,4 +53,7 @@ annotation class DependsOnMaven(val artifactLocator: String)
5353
* @param user Optional user name
5454
* @param password Optional password (required if user is defined)
5555
*/
56+
@Target(AnnotationTarget.FILE)
57+
@Retention(AnnotationRetention.SOURCE)
58+
@Repeatable
5659
annotation class MavenRepository(val id: String, val url: String, val user: String = "", val password: String = "")

0 commit comments

Comments
 (0)