зеркало из https://github.com/github/codeql.git
Kotlin: Tweak the build system
You can now make a versions/* directory that the build system doesn't know about. This can be used to add support for not-yet-supported versions.
This commit is contained in:
Родитель
eb59bc04cd
Коммит
72e08a9277
|
@ -169,7 +169,7 @@ def compile(jars, java_jars, dependency_folder, transform_to_embeddable, output,
|
|||
shutil.rmtree(tmp_src_dir)
|
||||
shutil.copytree('src', tmp_src_dir)
|
||||
|
||||
include_version_folder = tmp_src_dir + '/main/kotlin/utils/versions/to_include'
|
||||
include_version_folder = tmp_src_dir + '/main/kotlin/utils/this_version'
|
||||
os.makedirs(include_version_folder)
|
||||
|
||||
resource_dir = tmp_src_dir + '/main/resources/com/github/codeql'
|
||||
|
@ -193,11 +193,7 @@ def compile(jars, java_jars, dependency_folder, transform_to_embeddable, output,
|
|||
shutil.copytree(d, include_version_folder, dirs_exist_ok=True)
|
||||
|
||||
# remove all version folders:
|
||||
for version in kotlin_plugin_versions.many_versions:
|
||||
d = tmp_src_dir + '/main/kotlin/utils/versions/v_' + \
|
||||
version.replace('.', '_')
|
||||
if os.path.exists(d):
|
||||
shutil.rmtree(d)
|
||||
shutil.rmtree(tmp_src_dir + '/main/kotlin/utils/versions')
|
||||
|
||||
srcs = find_sources(tmp_src_dir)
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.github.codeql.comments
|
|||
import com.github.codeql.*
|
||||
import com.github.codeql.utils.IrVisitorLookup
|
||||
import com.github.codeql.utils.isLocalFunction
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
import com.github.codeql.utils.versions.getPsi2Ir
|
||||
import com.github.codeql.utils.versions.Psi2IrFacade
|
||||
import com.intellij.psi.PsiComment
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.github.codeql.utils
|
||||
|
||||
import com.github.codeql.utils.versions.Psi2IrFacade
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.github.codeql.utils.versions
|
||||
package com.github.codeql.utils
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
|
@ -8,4 +8,4 @@ import org.jetbrains.kotlin.psi.KtFile
|
|||
interface Psi2IrFacade {
|
||||
fun getKtFile(irFile: IrFile): KtFile?
|
||||
fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement?
|
||||
}
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
|
||||
fun getPsi2Ir(): Psi2IrFacade? = null
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
|||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
|
||||
fun getPsi2Ir(): Psi2IrFacade? = Psi2Ir()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче