This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from arrow-kt/is-ide-reorg
Re-org on #19
- Loading branch information
Showing
25 changed files
with
485 additions
and
107 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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.jvm" version "$KOTLIN_VERSION" apply false | ||
id "com.github.johnrengelman.shadow" version "$SHADOW_JAR_VERSION" apply false | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' } | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
hello-world/cli-and-ide-plugin/compiler-plugin/build.gradle
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,38 @@ | ||
/* | ||
* Copyright (C) 2019 The Arrow Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
plugins { | ||
id "org.jetbrains.kotlin.jvm" | ||
id "com.github.johnrengelman.shadow" | ||
} | ||
|
||
dependencies { | ||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" | ||
compileOnly "com.intellij:openapi:$OPENAPI_VERSION" | ||
compileOnly "io.arrow-kt:compiler-plugin:$ARROW_META_VERSION" | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions { | ||
freeCompilerArgs = ["-XXLanguage:+InlineClasses"] | ||
jvmTarget = "$JVM_TARGET_VERSION" | ||
} | ||
} | ||
|
||
shadowJar { | ||
configurations = [project.configurations.compileOnly] | ||
relocate 'org.jetbrains.kotlin.com.intellij', 'com.intellij' | ||
} |
23 changes: 23 additions & 0 deletions
23
...cli-and-ide-plugin/compiler-plugin/src/main/kotlin/io/arrowkt/example/HelloWorldPlugin.kt
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,23 @@ | ||
package io.arrowkt.example | ||
|
||
import arrow.meta.CliPlugin | ||
import arrow.meta.Meta | ||
import arrow.meta.invoke | ||
import arrow.meta.quotes.Transform | ||
import arrow.meta.quotes.namedFunction | ||
|
||
val Meta.helloWorld: CliPlugin | ||
get() = | ||
"Hello World" { | ||
meta( | ||
namedFunction({ name == "helloWorld" }) { c -> | ||
Transform.replace( | ||
replacing = c, | ||
newDeclaration = | ||
"""|fun helloWorld(): Unit = | ||
| println("Hello ΛRROW Meta!") | ||
|""".function.syntheticScope | ||
) | ||
} | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
...world/cli-and-ide-plugin/compiler-plugin/src/main/kotlin/io/arrowkt/example/MetaPlugin.kt
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,14 @@ | ||
package io.arrowkt.example | ||
|
||
import arrow.meta.CliPlugin | ||
import arrow.meta.Meta | ||
import arrow.meta.phases.CompilerContext | ||
import kotlin.contracts.ExperimentalContracts | ||
|
||
class MetaPlugin : Meta { | ||
@ExperimentalContracts | ||
override fun intercept(ctx: CompilerContext): List<CliPlugin> = | ||
listOf( | ||
helloWorld | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
.../main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
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 @@ | ||
io.arrowkt.example.MetaPlugin |
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
File renamed without changes.
5 changes: 2 additions & 3 deletions
5
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Wed Apr 22 22:53:19 CEST 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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,55 @@ | ||
/* | ||
* Copyright (C) 2020 The Arrow Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
plugins { | ||
id "org.jetbrains.kotlin.jvm" | ||
id "org.jetbrains.intellij" version "$INTELLIJ_GRADLE_PLUGIN_VERSION" | ||
} | ||
|
||
apply plugin: 'java' | ||
|
||
dependencies { | ||
implementation ("io.arrow-kt:idea-plugin:$ARROW_META_VERSION") { | ||
exclude group: "io.arrow-kt", module: "compiler-plugin" | ||
} | ||
implementation project(path: ':compiler-plugin', configuration: 'shadow') | ||
} | ||
|
||
buildSearchableOptions.enabled = false | ||
|
||
intellij { | ||
version "$INTELLIJ_IDEA_VERSION" | ||
pluginName = "Example" | ||
plugins = ["gradle", "gradle-java", "java", "org.jetbrains.kotlin:${KOTLIN_IDEA_VERSION}"] | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = "$JVM_TARGET_VERSION" | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = "$JVM_TARGET_VERSION" | ||
} | ||
|
||
runIde { | ||
jvmArgs '-Xmx2G' | ||
} | ||
|
||
patchPluginXml { | ||
changeNotes """ | ||
Add change notes here.<br> | ||
<em>most HTML tags may be used</em>""" | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...in/src/main/resources/META-INF/plugin.xml → ...in/src/main/resources/META-INF/plugin.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ':compiler-plugin' | ||
include ':ide-plugin' |
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ allprojects { | |
mavenCentral() | ||
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' } | ||
} | ||
} | ||
} |
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,6 @@ | ||
KOTLIN_VERSION=1.3.61 | ||
KOTLIN_TEST_VERSION=3.4.2 | ||
JVM_TARGET_VERSION=1.8 | ||
ARROW_VERSION=0.10.5 | ||
ARROW_META_VERSION=1.3.61-SNAPSHOT | ||
SHADOW_JAR_VERSION=5.2.0 |
5 changes: 2 additions & 3 deletions
5
hello-world/compiler-plugin/gradle/wrapper/gradle-wrapper.properties
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Wed Apr 22 22:53:19 CEST 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.