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