Unable to upgrade intellij plugin from 0.4.21 to 1.0

已回答

I have a plugin that I'm working on. Tried to upgrade to the com.jetbrains.intellij plugin from 0.4.21 to 1.0 today in IntelliJ community v 2020.2 build 202.8194.7 . The error:

A problem occurred evaluating root project 'build-variant-matrix'.
> No signature of method: build_d7zsoyxgbh9rcsw4i4jurq1m0.intellij() is applicable for argument types: (build_d7zsoyxgbh9rcsw4i4jurq1m0$_run_closure1) values: [build_d7zsoyxgbh9rcsw4i4jurq1m0$_run_closure1@52a03520]

 

buildscript {
repositories {
mavenCentral()
jcenter()
}
}

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.10'
id 'org.jetbrains.intellij' version '1.0'

//id 'org.jetbrains.kotlin.jvm' version '1.3.72'
//id 'org.jetbrains.intellij' version '0.4.21'
}

group 'com.nilsenlabs.flavormatrix'
version '0.5.6'

intellij {
version = '202.7660.26' // IntelliJ IDEA version used in Android Studio 4.2.1
type 'IC' // Community edition
plugins 'android'
//updateSinceUntilBuild false
}

patchPluginXml {
changeNotes """
<ul>
<li>0.5.6 Improved release notes</li>
</ul>
"""
}

runIde {
// Absolute path to installed target 4.1 Android Studio to use as IDE Development Instance
ideDirectory 'C:/Programfiler/android/Android Studio' // Work computer
}

repositories {
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
testCompile "org.mockito:mockito-core:2.+"
}

publishPlugin {
token project.properties['jetbrains.publish.token']
}
0

Frode, as described in the Gradle IntelliJ Plugin 1.0 Migration Guide, Restrictive Groovy syntax section – you're supposed to use the explicit assignment in your configuration, like:

intellij {
version = '202.7660.26' // IntelliJ IDEA version used in Android Studio 4.2.1
type = 'IC' // Community edition
plugins = ['android']
//updateSinceUntilBuild false
}

 

1

Thanks. The next struggle was how to construct a Directory object. Worked around it like this:

 


def dir = project.getLayout().getProjectDirectory().dir('C:/Programfiler/android/Android Studio')
ideDir.set(dir)
0

请先登录再写评论。