From 34c0583a611872443d24c7bc3e8e4368f11bb079 Mon Sep 17 00:00:00 2001 From: Andreas Rossbacher Date: Thu, 30 Jul 2020 17:39:35 -0700 Subject: [PATCH] Adding Proguard annotation. Cleanup/modernization to get the project building. --- build.gradle | 95 ++++++++++++++++------------- release.sh | 2 +- src/main/kotlin/ScriptDirectives.kt | 6 ++ 3 files changed, 58 insertions(+), 45 deletions(-) diff --git a/build.gradle b/build.gradle index 48869d6..350ed19 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,19 @@ buildscript { - ext.kotlin_version = '1.2.70' + ext.kotlin_version = '1.3.72' - repositories { - mavenCentral() - } + repositories { + mavenCentral() + jcenter() + } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } } -plugins { id "com.jfrog.bintray" version "1.8.1" } +plugins { + id "com.jfrog.bintray" version "1.8.1" +} //apply plugin: 'java' apply plugin: 'kotlin' @@ -19,12 +22,12 @@ apply plugin: 'maven-publish' repositories { - mavenCentral() - jcenter() + mavenCentral() + jcenter() } group = 'com.github.holgerbrandl' -version = '1.4' +version = '1.5' // should not be needed //dependencies { @@ -32,59 +35,63 @@ version = '1.4' //} task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource + classifier = 'sources' + from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir + classifier = 'javadoc' + from javadoc.destinationDir } artifacts { - archives sourcesJar - archives javadocJar + archives sourcesJar + archives javadocJar } publishing { - publications { - maven(MavenPublication) { - from components.java - artifact sourcesJar { classifier "sources" } - artifact javadocJar + publications { + maven(MavenPublication) { + from components.java + artifact sourcesJar { classifier "sources" } + artifact javadocJar // artifactId = 'kscript-annotations' - } } + } } if (hasProperty('bintray_user') && hasProperty('bintray_key')) { - bintray { + bintray { - // property must be set in ~/.gradle/gradle.properties - user = bintray_user - key = bintray_key + // property must be set in ~/.gradle/gradle.properties + user = bintray_user + key = bintray_key - publications = ['maven'] //When uploading configuration files + publications = ['maven'] //When uploading configuration files - dryRun = false //Whether to run this as dry-run, without deploying - publish = true // If version should be auto published after an upload + dryRun = false //Whether to run this as dry-run, without deploying + publish = true // If version should be auto published after an upload - pkg { - repo = 'github' - name = 'kscript-annotations' - vcsUrl = 'https://github.com/holgerbrandl/kscript-annotations' + pkg { + repo = 'github' + name = 'kscript-annotations' + vcsUrl = 'https://github.com/holgerbrandl/kscript-annotations' - licenses = ['MIT'] - publicDownloadNumbers = true + licenses = ['MIT'] + publicDownloadNumbers = true - //Optional version descriptor - version { - name = project.version //Bintray logical version name - desc = '.' - released = new Date() - vcsTag = 'v' + project.version - } - } + //Optional version descriptor + version { + name = project.version //Bintray logical version name + desc = '.' + released = new Date() + vcsTag = 'v' + project.version + } } + } +} + +dependencies { + compile("org.jetbrains.kotlin:kotlin-stdlib") } diff --git a/release.sh b/release.sh index a0a29db..eea468d 100644 --- a/release.sh +++ b/release.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash ## -## Release Steps For new Annotation Support Libary Version +## Release Steps For new Annotation Support Library Version ## export KANNOT_HOME="/d/projects/misc/kscript-annotations"; diff --git a/src/main/kotlin/ScriptDirectives.kt b/src/main/kotlin/ScriptDirectives.kt index 2f0c426..e169465 100644 --- a/src/main/kotlin/ScriptDirectives.kt +++ b/src/main/kotlin/ScriptDirectives.kt @@ -33,6 +33,12 @@ annotation class KotlinOpts(val runOptions: String) @Repeatable annotation class CompilerOpts(val kotlincFlags: String) +@Target(AnnotationTarget.FILE) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +@Repeatable +annotation class ProguardConfig(val proguardConfig: 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