Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ast-psi/src/main/kotlin/kastree/ast/psi/Parser.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package kastree.ast.psi

import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer
Expand All @@ -13,9 +15,11 @@ import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType

open class Parser(val converter: Converter = Converter) {
protected val proj by lazy {
val configuration = CompilerConfiguration()
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
KotlinCoreEnvironment.createForProduction(
Disposer.newDisposable(),
CompilerConfiguration(),
configuration,
EnvironmentConfigFiles.JVM_CONFIG_FILES
).project
}
Expand Down
81 changes: 4 additions & 77 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.4.0'

repositories {
mavenCentral()
Expand All @@ -11,8 +11,8 @@ buildscript {
}

allprojects {
group 'com.github.cretz.kastree'
version '0.5.0-SNAPSHOT'
group 'com.github.jforbes.kastree'
version '0.5.0'

repositories {
mavenCentral()
Expand All @@ -22,12 +22,12 @@ allprojects {

project(':ast:ast-common') {
apply plugin: 'kotlin-platform-common'
sourceCompatibility = '1.6'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
}
publishSettings(project, 'kastree-ast-common', 'Common library for Kastree AST')
}

project(':ast:ast-jvm') {
Expand All @@ -54,7 +54,6 @@ project(':ast:ast-jvm') {
events 'passed', 'skipped', 'failed'
}
}
publishSettings(project, 'kastree-ast-jvm', 'JVM library for Kastree AST')
}

project(':ast-psi') {
Expand Down Expand Up @@ -82,76 +81,4 @@ project(':ast-psi') {
events 'passed', 'skipped', 'failed'
}
}
publishSettings(project, 'kastree-ast-psi', 'JVM library Kastree parsing')
}

def publishSettings(project, projectName, projectDescription) {
project.with {
if (!project.hasProperty('ossrhUsername')) return
apply plugin: 'maven'
apply plugin: 'signing'

archivesBaseName = projectName

task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
if (project.name.endsWith('-jvm') || project.name.endsWith('-js')) {
duplicatesStrategy = 'exclude'
def commonProject = project.parent.subprojects.find { it.name.endsWith('-common') }
from(sourceSets.main.allSource + commonProject.sourceSets.main.allSource)
}
}

task packageJavadoc(type: Jar) {
// Empty to satisfy Sonatype's javadoc.jar requirement
classifier 'javadoc'
}

artifacts {
archives packageSources, packageJavadoc
}

signing {
sign configurations.archives
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name projectName
packaging 'jar'
description projectDescription
url 'https://github.com/cretz/kastree'
scm {
connection 'scm:git:git@github.com:cretz/kastree.git'
developerConnection 'scm:git:git@github.com:cretz/kastree.git'
url 'git@github.com:cretz/kastree.git'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'cretz'
name 'Chad Retz'
url 'https://github.com/cretz'
}
}
}
}
}
}
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading