Move jflex download out from update_dependencies, add lexer (ant) tasks to frontend project

This commit is contained in:
Ilya Chernikov
2017-11-15 16:55:18 +01:00
committed by Vyacheslav Gerasimov
parent 90e5558704
commit 98204aa2d3
4 changed files with 26 additions and 12 deletions
+3 -1
View File
@@ -17,7 +17,8 @@ buildscript {
"https://plugins.gradle.org/m2") "https://plugins.gradle.org/m2")
"https://plugins.gradle.org/m2", "https://plugins.gradle.org/m2",
"http://dl.bintray.com/kotlin/kotlinx", "http://dl.bintray.com/kotlin/kotlinx",
"https://repo.gradle.org/gradle/libs-releases-local") // for native-platform "https://repo.gradle.org/gradle/libs-releases-local", // for native-platform
"https://jetbrains.bintray.com/intellij-third-party-dependencies") // for jflex
extra["repos"] = repos extra["repos"] = repos
@@ -131,6 +132,7 @@ extra["versions.ant-launcher"] = "1.8.0"
extra["versions.robolectric"] = "3.1" extra["versions.robolectric"] = "3.1"
extra["versions.org.springframework"] = "4.2.0.RELEASE" extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.idea.NodeJS"] = "172.3757.32" extra["versions.idea.NodeJS"] = "172.3757.32"
extra["versions.jflex"] = "1.7.0"
val markdownVer = "4054 - Kotlin 1.0.2-dev-566".replace(" ", "%20") // fixed here, was last with "status:SUCCESS,tag:forKotlin" val markdownVer = "4054 - Kotlin 1.0.2-dev-566".replace(" ", "%20") // fixed here, was last with "status:SUCCESS,tag:forKotlin"
extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/$markdownVer/([artifact]_[ext]/)[artifact](.[ext])" extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/$markdownVer/([artifact]_[ext]/)[artifact](.[ext])"
+8
View File
@@ -3,6 +3,8 @@ apply { plugin("kotlin") }
jvmTarget = "1.6" jvmTarget = "1.6"
val jflexPath by configurations.creating
dependencies { dependencies {
compile(project(":core:descriptors")) compile(project(":core:descriptors"))
compile(project(":core:deserialization")) compile(project(":core:deserialization"))
@@ -11,9 +13,15 @@ dependencies {
compile(project(":compiler:resolution")) compile(project(":compiler:resolution"))
compile(projectDist(":kotlin-script-runtime")) compile(projectDist(":kotlin-script-runtime"))
compile(commonDep("io.javaslang","javaslang")) compile(commonDep("io.javaslang","javaslang"))
jflexPath(commonDep("org.jetbrains.intellij.deps.jflex", "jflex"))
} }
sourceSets { sourceSets {
"main" { projectDefault() } "main" { projectDefault() }
"test" {} "test" {}
} }
ant.importBuild("buildLexer.xml")
ant.properties["builddir"] = buildDir.absolutePath
ant.properties["flex.classpath"] = jflexPath.asPath
+15 -5
View File
@@ -1,12 +1,13 @@
<project name="KotlinLexer" default="lexer"> <project name="KotlinLexer" default="lexer">
<property name="home" value="${basedir}"/> <property name="home" value="${basedir}"/>
<property name="flex.base" value="${home}/../../dependencies/jflex"/> <property name="builddir" value="${basedir}/build"/>
<property name="out.dir" value="${basedir}/tmpout"/> <property name="flex.classpath" value="${home}/../../dependencies/jflex/JFlex.jar"/>
<property name="out.dir" value="${builddir}/tmpout"/>
<macrodef name="flex"> <macrodef name="flex">
<attribute name="flexfile"/> <attribute name="flexfile"/>
<attribute name="destdir"/> <attribute name="destdir"/>
<attribute name="skeleton" default="${flex.base}/idea-flex.skeleton"/> <attribute name="skeleton" default="${builddir}/idea-flex.skeleton"/>
<sequential> <sequential>
<delete dir="${out.dir}"/> <delete dir="${out.dir}"/>
<mkdir dir="${out.dir}"/> <mkdir dir="${out.dir}"/>
@@ -20,7 +21,7 @@
<arg value="${out.dir}"/> <arg value="${out.dir}"/>
<arg value="@{flexfile}"/> <arg value="@{flexfile}"/>
<classpath> <classpath>
<pathelement location="${flex.base}/JFlex.jar"/> <pathelement path="${flex.classpath}"/>
</classpath> </classpath>
</java> </java>
<move todir="@{destdir}"> <move todir="@{destdir}">
@@ -32,7 +33,16 @@
</sequential> </sequential>
</macrodef> </macrodef>
<target name="lexer"> <target name="check-idea-flex.skeleton.exists">
<available file="${builddir}/idea-flex.skeleton" property="skjeleton.exisits"/>
</target>
<target name="get-idea-flex.skeleton.if.not.exists" depends="check-idea-flex.skeleton.exists" unless="skjeleton.exisits">
<get src="https://raw.github.com/JetBrains/intellij-community/master/tools/lexer/idea-flex.skeleton"
dest="${builddir}/idea-flex.skeleton" usetimestamp="true"/>
</target>
<target name="lexer" depends="get-idea-flex.skeleton.if.not.exists">
<flex flexfile="${home}/src/org/jetbrains/kotlin/lexer/Kotlin.flex" <flex flexfile="${home}/src/org/jetbrains/kotlin/lexer/Kotlin.flex"
destdir="${home}/src/org/jetbrains/kotlin/lexer/"/> destdir="${home}/src/org/jetbrains/kotlin/lexer/"/>
-6
View File
@@ -133,12 +133,6 @@
<delete dir="${dependencies}/dx-src" failonerror="false"/> <delete dir="${dependencies}/dx-src" failonerror="false"/>
<untar src="${dependencies}/download/${android-sources.tgz}" dest="${dependencies}/dx-src" compression="gzip"/> <untar src="${dependencies}/download/${android-sources.tgz}" dest="${dependencies}/dx-src" compression="gzip"/>
<mkdir dir="${dependencies}/jflex"/>
<get src="https://jetbrains.bintray.com/intellij-third-party-dependencies/org/jetbrains/intellij/deps/jflex/jflex/1.7.0/jflex-1.7.0.jar"
dest="${dependencies}/jflex/JFlex.jar" usetimestamp="true"/>
<get src="https://raw.github.com/JetBrains/intellij-community/master/tools/lexer/idea-flex.skeleton"
dest="${dependencies}/jflex/idea-flex.skeleton" usetimestamp="true"/>
<!-- jline --> <!-- jline -->
<get-maven-library prefix="org/jline" lib="jline" version="3.3.1" target.jar.name.base="jline3"/> <get-maven-library prefix="org/jline" lib="jline" version="3.3.1" target.jar.name.base="jline3"/>