forked from flutter/flutter-intellij
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
111 lines (100 loc) · 2.72 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* Copyright 2019 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
buildscript {
repositories {
mavenCentral()
maven {
url=uri("https://www.jetbrains.com/intellij-repository/snapshots/")
}
maven {
url=uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url=uri("https://www.jetbrains.com/intellij-repository/releases")
}
gradlePluginPortal()
}
}
plugins {
id("org.jetbrains.intellij") version "1.13.1-SNAPSHOT"
id("org.jetbrains.kotlin.jvm") version "1.8.20-Beta"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url=uri("https://www.jetbrains.com/intellij-repository/snapshots/")
}
maven {
url=uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url=uri("https://www.jetbrains.com/intellij-repository/releases")
}
}
// Specify UTF-8 for all compilations so we avoid Windows-1252.
allprojects {
tasks.withType<JavaCompile>() {
options.encoding = "UTF-8"
}
tasks.withType<Test>() {
systemProperty("file.encoding", "UTF-8")
}
}
val ide: String by project
val flutterPluginVersion: String by project
val javaVersion: String by project
val dartVersion: String by project
val baseVersion: String by project
val name: String by project
val buildSpec: String by project
val smaliPlugin: String by project
val langPlugin: String by project
group = "io.flutter"
version = flutterPluginVersion
java {
sourceCompatibility = JavaVersion.toVersion(javaVersion)
targetCompatibility = JavaVersion.toVersion(javaVersion)
}
intellij {
pluginName.set(name)
// This adds nullability assertions, but also compiles forms.
instrumentCode.set(true)
updateSinceUntilBuild.set(false)
localPath.set("${project.rootDir.absolutePath}/artifacts/$ide")
downloadSources.set(false)
val pluginList = mutableListOf(
project(":flutter-idea"), "java", "properties",
"junit", "Git4Idea", "Kotlin", "gradle", "org.jetbrains.android",
"Groovy", "Dart:$dartVersion")
pluginList.add(smaliPlugin)
pluginList.add(langPlugin)
if (ide == "android-studio") {
pluginList += listOf(project(":flutter-studio"))
} else if ("$buildSpec" == "2020.3") {
pluginList += listOf("gradle-dsl-impl")
}
plugins.set(pluginList)
}
tasks {
buildSearchableOptions {
enabled = false
}
}
dependencies {
implementation(project("flutter-idea", "instrumentedJar")) // Second arg is required to use forms
if (ide == "android-studio") {
implementation(project("flutter-studio"))
}
}
tasks {
instrumentCode {
compilerVersion.set("$baseVersion")
}
instrumentTestCode {
compilerVersion.set("$baseVersion")
}
}