Skip to content

Commit

Permalink
Androdi Studio Koala compat (#120) (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppeman authored Sep 7, 2024
1 parent 1829056 commit d38fee1
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 53 deletions.
18 changes: 0 additions & 18 deletions globallydynamic-android-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ buildscript {
apply from: 'deps.gradle'

repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.androidplugin"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsplugin"
classpath "com.jeppeman.globallydynamic.gradle:plugin:$versions.globallydynamic_gradle"
classpath "com.vanniktech:gradle-android-javadoc-plugin:$versions.javadoc"
}
Expand All @@ -31,7 +29,6 @@ ext {

allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo' }
Expand Down Expand Up @@ -115,21 +112,6 @@ subprojects {
}
}

apply plugin: "com.github.ben-manes.versions"

dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
5 changes: 2 additions & 3 deletions globallydynamic-android-lib/deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ def versions = [
kotlin : '1.9.0',
appcompat : '1.4.2',
coroutines : '1.6.2',
androidplugin : '8.1.1',
androidplugin : '8.6.0',
lifecycle : '2.4.1',
lifecycle_extensions : '2.2.0',
mockito : '5.4.0',
Expand All @@ -11,7 +11,6 @@ def versions = [
truth : '1.2.0',
espresso : '3.4.0',
runner : '1.2.0',
versionsplugin : '0.28.0',
material : '1.6.1',
constraintlayout : '2.1.4',
core : '1.8.0',
Expand All @@ -25,7 +24,7 @@ def versions = [
play : '1.10.3',
dynamicability : '1.0.17.300',
autoservice : '1.0-rc6',
globallydynamic_gradle: '1.7.0',
globallydynamic_gradle: '1.8.0',
uiautomator : '2.2.0',
javadoc : '0.3.0'
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
5 changes: 2 additions & 3 deletions globallydynamic-android-lib/minimal-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.1.1:"
classpath "com.jeppeman.globallydynamic.gradle:plugin:1.7.0"
classpath "com.android.tools.build:gradle:8.6.0"
classpath "com.jeppeman.globallydynamic.gradle:plugin:1.8.0"
}
}

Expand Down
18 changes: 0 additions & 18 deletions globallydynamic-server-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ buildscript {
apply from: 'deps.gradle'

repositories {
jcenter()
google()
mavenCentral()
maven {
Expand All @@ -13,7 +12,6 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1"
classpath "com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.3"
classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsplugin"
classpath "com.github.johnrengelman:shadow:$versions.shadowjar"
}
}
Expand All @@ -40,7 +38,6 @@ subprojects {
}

repositories {
jcenter()
google()
mavenCentral()
}
Expand All @@ -63,21 +60,6 @@ subprojects {
}
}

apply plugin: "com.github.ben-manes.versions"

dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
1 change: 0 additions & 1 deletion globallydynamic-server-lib/deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import java.nio.file.Paths
def versions = [
kotlin : '1.8.21',
jetty : '9.4.27.v20200227',
versionsplugin: '0.25.0',
shadowjar : '8.1.1',
guava : '30.1-jre',
bundletool : '1.11.2',
Expand Down
10 changes: 7 additions & 3 deletions globallydynamic-studio-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id 'org.jetbrains.intellij' version '1.16.1'
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
id 'org.jetbrains.intellij' version '1.17.4'
}

apply from: 'deps.gradle'
Expand Down Expand Up @@ -45,7 +45,7 @@ intellij {
localPath = "${System.getenv("ANDROID_STUDIO_PATH")}"
}

def instrumentCompilerVersion = "231.9392.1"
def instrumentCompilerVersion = "241.18034.62"

instrumentCode {
compilerVersion = instrumentCompilerVersion
Expand All @@ -64,6 +64,10 @@ buildSearchableOptions.systemProperty("idea.is.internal", "")

patchPluginXml {
changeNotes = """
<h1>1.11.0</h1>
<ul>
<li>Android Studio Koala Feature Drop (2024.1.2) compatibility</li>
</ul>
<h1>1.10.0</h1>
<ul>
<li>Android Studio Hedgehog (2023.1.1) compatibility</li>
Expand Down
2 changes: 1 addition & 1 deletion globallydynamic-studio-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.jeppeman.globallydynamic.idea
VERSION_NAME=1.11.0-SNAPSHOT
VERSION_NAME=1.12.0-SNAPSHOT

POM_DESCRIPTION=GloballyDynamic Studio - Embeds a GloballyDynamic server into Android Studio that apps will download their splits from.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.jeppeman.globallydynamic.idea.tooling

import com.android.tools.idea.gradle.util.ImportUtil
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtil
import com.jeppeman.globallydynamic.idea.utils.runInBackground
import com.jeppeman.globallydynamic.idea.utils.runInBackgroundAndWait
import org.gradle.tooling.BuildAction
import org.gradle.tooling.GradleConnector
import org.gradle.tooling.ProjectConnection
Expand Down Expand Up @@ -129,7 +126,7 @@ private fun createClassPathString(paths: List<String?>): String? {
classpath.append("classpath files([")
val pathCount = paths.size
for (i in 0 until pathCount) {
val jarPath = ImportUtil.escapeGroovyStringLiteral(paths[i]!!)
val jarPath = escapeGroovyStringLiteral(paths[i]!!)
classpath.append("'").append(jarPath).append("'")
if (i < pathCount - 1) {
classpath.append(", ")
Expand All @@ -139,6 +136,21 @@ private fun createClassPathString(paths: List<String?>): String? {
return classpath.toString()
}

private fun escapeGroovyStringLiteral(s: String): String {
val sb = java.lang.StringBuilder(s.length + 5)
var i = 0
val n = s.length
while (i < n) {
val c = s[i]
if (c == '\\' || c == '\'') {
sb.append('\\')
}
sb.append(c)
i++
}
return sb.toString()
}

private val jarPaths: List<String>
get() = listOf(
getJarPathForClass(GloballyDynamicToolingPlugin::class.java),
Expand Down

0 comments on commit d38fee1

Please sign in to comment.