Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
semoro committed Feb 22, 2018
2 parents 79a7a13 + 3eb2321 commit f37d9c3
Show file tree
Hide file tree
Showing 132 changed files with 1,737 additions and 425 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ gradle-app.setting
!lib/*.jar

local.properties
android.local.properties
android.local.properties

!runners/gradle-integration-tests/testData/basic/classDir/**/*.class
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dokka {
skipDeprecated = false
// Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions
reportNotDocumented = true
reportUndocumented = true
skipEmptyPackages = true // Do not create index pages for empty packages
Expand Down Expand Up @@ -132,6 +132,11 @@ dokka {
reportUndocumented = true // Emit warnings about not documented members
includeNonPublic = false
}
// Suppress a package
packageOptions {
prefix = "kotlin.internal" // will match kotlin.internal and all sub-packages of it
suppress = true
}
}
```

Expand Down
60 changes: 48 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
import org.jetbrains.DependenciesVersionGetter

allprojects {
group 'org.jetbrains.dokka'
version dokka_version

def repo = {
artifactPattern("https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/[revision]/internal/[module](.[ext])")
artifactPattern("https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/[revision]/([module]_[ext]/)[module](.[ext])")
}

buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "http://dl.bintray.com/kotlin/kotlin-eap-1.1"
}
maven {
url "https://dl.bintray.com/kotlin/kotlin-dev"
}
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url "http://dl.bintray.com/kotlin/kotlin-eap" }
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
maven { url "https://plugins.gradle.org/m2/" }
ivy(repo)
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'

classpath "com.gradle.publish:plugin-publish-plugin:0.9.6"
classpath "com.gradle.publish:plugin-publish-plugin:0.9.10"
}
}

repositories {
mavenCentral()
mavenLocal()
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
maven { url "http://dl.bintray.com/kotlin/kotlin-eap" }
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
maven { url 'https://jitpack.io' }
maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$bundled_kotlin_compiler_version/maven" }
ivy(repo)
}
}

Expand Down Expand Up @@ -60,6 +64,38 @@ def bintrayPublication(project, List<String> _publications) {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.2'
gradleVersion = '4.2.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}

def versions = DependenciesVersionGetter.getVersions(project, bundled_kotlin_compiler_version)

ext.ideaVersion = versions["idea.build.id"]
ext.markdownVersion = versions["markdown.build.id"].replace("%20", " ")

configurations {
ideaIC
intellijCore
}

repositories {
maven { url 'https://www.jetbrains.com/intellij-repository/snapshots' }
maven { url 'https://www.jetbrains.com/intellij-repository/releases' }
}

dependencies {
intellijCore "com.jetbrains.intellij.idea:intellij-core:$ideaVersion"
ideaIC "com.jetbrains.intellij.idea:ideaIC:$ideaVersion"
}

def intellijCoreAnalysis() {
return zipTree(configurations.intellijCore.singleFile).matching ({
include("intellij-core-analysis.jar")
})
}

def ideaRT() {
return zipTree(project.configurations.ideaIC.singleFile).matching ({
include("lib/idea_rt.jar")
})
}
8 changes: 2 additions & 6 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ apply plugin: 'groovy'
repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/kotlin/kotlin-eap"
}
maven {
url "https://dl.bintray.com/kotlin/kotlin-dev"
}
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
}
dependencies {
compile 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.jetbrains

import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleVersionIdentifier
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.SelfResolvingDependency
import org.gradle.api.publish.internal.ProjectDependencyPublicationResolver
import org.gradle.api.publish.maven.MavenPom
import org.gradle.api.publish.maven.MavenPublication

static void configure(MavenPublication publication, Project project) {
publication.artifact(project.tasks.shadowJar)

publication.pom { MavenPom pom ->
pom.withXml { xml ->
def dependenciesNode = xml.asNode().appendNode('dependencies')

project.configurations.shadow.allDependencies.each {
//if (! (it instanceof SelfResolvingDependency)) {
if (it instanceof ProjectDependency) {
def projectDependencyResolver = project.gradle.services.get(ProjectDependencyPublicationResolver)
ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(it)
addDependency(dependenciesNode, identifier)
} else if (!(it instanceof SelfResolvingDependency)) {
addDependency(dependenciesNode, it)
}

}
}
}
}

private static void addDependency(Node dependenciesNode, dep) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dep.group)
dependencyNode.appendNode('artifactId', dep.name)
dependencyNode.appendNode('version', dep.version)
dependencyNode.appendNode('scope', 'runtime')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.jetbrains

import org.gradle.api.Project

class DependenciesVersionGetter {
static Properties getVersions(Project project, String artifactVersionSelector) {
def dep = project.dependencies.create(group: 'teamcity', name: 'dependencies', version: artifactVersionSelector, ext: 'properties')
def file = project.configurations.detachedConfiguration(dep).resolve().first()

def prop = new Properties()
prop.load(new FileReader(file))
return prop
}
}
25 changes: 15 additions & 10 deletions buildSrc/src/main/groovy/org/jetbrains/PluginXmlTransformer.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jetbrains

import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext
import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
Expand All @@ -22,7 +23,7 @@ public class PluginXmlTransformer implements Transformer {
def inputStream = context.is
System.out.println(path)
Node node = new XmlParser().parse(inputStream)
relocateXml(node, context.relocators)
relocateXml(node, context)
transformedPluginXmlFiles.put(path, node)
}

Expand All @@ -39,28 +40,32 @@ public class PluginXmlTransformer implements Transformer {
}
}

private static void relocateXml(Node node, List<Relocator> relocators) {
private static void relocateXml(Node node, TransformerContext context) {
Map attributes = node.attributes()
RelocateClassContext relocateClassContext = new RelocateClassContext()
relocateClassContext.stats = context.stats
for (Map.Entry entry : attributes.entrySet()) {
entry.setValue(relocateClassName((String) entry.getValue(), relocators))
relocateClassContext.setClassName((String) entry.getValue())
entry.setValue(relocateClassName(relocateClassContext, context))
}
List<String> localText = node.localText()
if (localText.size() == 1) {
node.setValue(relocateClassName(localText[0], relocators))
relocateClassContext.setClassName(localText[0])
node.setValue(relocateClassName(relocateClassContext, context))
}
node.children().each {
if (it instanceof Node) {
relocateXml((Node) it, relocators)
relocateXml((Node) it, context)
}
}
}

private static String relocateClassName(String className, List<Relocator> relocators) {
for (Relocator relocator : relocators) {
if (relocator.canRelocateClass(className)) {
return relocator.relocateClass(className)
private static String relocateClassName(RelocateClassContext relocateContext, TransformerContext context) {
for (Relocator relocator : context.relocators) {
if (relocator.canRelocateClass(relocateContext)) {
return relocator.relocateClass(relocateContext)
}
}
return className
return relocateContext.className
}
}
28 changes: 19 additions & 9 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ buildscript {

apply plugin: 'kotlin'

sourceCompatibility = 1.6
sourceCompatibility = 1.8

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.2"
apiVersion = languageVersion
jvmTarget = "1.8"
}
}

dependencies {
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_version
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version
compile "org.jetbrains.kotlin:kotlin-stdlib:$bundled_kotlin_compiler_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$bundled_kotlin_compiler_version"

compile group: 'com.google.inject', name: 'guice', version: '3.0'
compile "org.jsoup:jsoup:1.8.3"

compile files("../lib/intellij-core-analysis.jar")
compile "org.jetbrains.kotlin:kotlin-compiler:$bundled_kotlin_compiler_version"
compile "org.jetbrains.kotlin:kotlin-script-runtime:$bundled_kotlin_compiler_version"

compile group: 'org.jetbrains.kotlin', name: 'kotlin-compiler', version: kotlin_version
compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-runtime', version: kotlin_version
compile files("../lib/kotlin-ide-common.jar")
compile files("../lib/markdown.jar")
compile "teamcity:kotlin-ide-common:$bundled_kotlin_compiler_version"
compile "teamcity:markdown:$markdownVersion"

compile intellijCoreAnalysis()

//tools.jar
def toolsJar = files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") })
Expand All @@ -34,5 +43,6 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version
testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0"
}

testCompile ideaRT()
}
Loading

0 comments on commit f37d9c3

Please sign in to comment.