Skip to content

Commit ad6211c

Browse files
authored
Get rid of JCenter and kotlin-dev repository (#2530)
* Also, update Gradle, because previous versions cannot follow redirects, effectively failing builds * Leave kotlin-dep repo for our hacked Dokka version and JB's fork of trove4j
1 parent e21c455 commit ad6211c

File tree

9 files changed

+58
-85
lines changed

9 files changed

+58
-85
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ buildscript {
117117
}
118118
```
119119

120-
Make sure that you have either `jcenter()` or `mavenCentral()` in the list of repositories:
120+
Make sure that you have `mavenCentral()` in the list of repositories:
121121

122122
```
123123
repository {
124-
jcenter()
124+
mavenCentral()
125125
}
126126
```
127127

@@ -143,7 +143,7 @@ plugins {
143143
}
144144
```
145145

146-
Make sure that you have either `jcenter()` or `mavenCentral()` in the list of repositories.
146+
Make sure that you have `mavenCentral()` in the list of repositories.
147147

148148
### Android
149149

build.gradle

+3-26
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,7 @@ buildscript {
5353
}
5454

5555
repositories {
56-
jcenter()
57-
maven {
58-
url "https://kotlin.bintray.com/kotlinx"
59-
credentials {
60-
username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: ""
61-
password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: ""
62-
}
63-
}
56+
maven {url "https://kotlin.bintray.com/kotlinx"}
6457
// Future replacement for kotlin-dev, with cache redirector
6558
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
6659
maven {
@@ -70,7 +63,6 @@ buildscript {
7063
password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: ""
7164
}
7265
}
73-
maven { url "https://kotlin.bintray.com/kotlin-eap" }
7466
maven { url "https://jetbrains.bintray.com/kotlin-native-dependencies" }
7567
maven { url "https://plugins.gradle.org/m2/" }
7668
}
@@ -157,25 +149,10 @@ allprojects {
157149
* transitive dependencies was removed from jcenter, thus breaking gradle dependency resolution
158150
*/
159151
google()
160-
jcenter()
152+
mavenCentral()
161153
// Future replacement for kotlin-dev, with cache redirector
162154
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
163-
maven {
164-
url "https://kotlin.bintray.com/kotlin-dev"
165-
credentials {
166-
username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: ""
167-
password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: ""
168-
}
169-
}
170-
maven { url "https://kotlin.bintray.com/kotlin-eap" }
171-
maven {
172-
url "https://kotlin.bintray.com/kotlinx"
173-
credentials {
174-
username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: ""
175-
password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: ""
176-
}
177-
}
178-
mavenLocal()
155+
maven { url "https://kotlin.bintray.com/kotlinx" }
179156
}
180157
}
181158

buildSrc/build.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoole
1414
repositories {
1515
if (cacheRedirectorEnabled) {
1616
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
17-
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap")
1817
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
1918
} else {
2019
maven("https://plugins.gradle.org/m2")
21-
maven("https://dl.bintray.com/kotlin/kotlin-eap")
2220
maven("https://dl.bintray.com/kotlin/kotlin-dev")
2321
}
2422

docs/topics/coroutines-basic-jvm.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ dependencies {
3232
```
3333
</tabs>
3434

35-
This library is published to Bintray JCenter repository, so add the following:
35+
This library is published to Bintray Maven Central repository, so add the following:
3636

3737
```groovy
3838
repositories {
39-
jcenter()
39+
mavenCentral()
4040
}
4141
```
4242

@@ -77,18 +77,6 @@ Since we'll be using the [`kotlinx.coroutines`](https://github.com/Kotlin/kotlin
7777
</dependencies>
7878
```
7979

80-
This library is published to Bintray JCenter repository, so let us add it:
81-
82-
```xml
83-
<repositories>
84-
...
85-
<repository>
86-
<id>central</id>
87-
<url>https://jcenter.bintray.com</url>
88-
</repository>
89-
</repositories>
90-
```
91-
9280
That's it, we are good to go and write code under `src/main/kotlin`.
9381

9482
## My first coroutine

gradle/wrapper/gradle-wrapper.jar

2.96 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
distributionBase=GRADLE_USER_HOME
66
distributionPath=wrapper/dists
7+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
78
zipStoreBase=GRADLE_USER_HOME
89
zipStorePath=wrapper/dists
9-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

gradlew

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
5+
#
6+
37
##############################################################################
48
##
59
## Gradle start up script for UN*X
@@ -28,7 +32,7 @@ APP_NAME="Gradle"
2832
APP_BASE_NAME=`basename "$0"`
2933

3034
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
35+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3236

3337
# Use the maximum available, or set MAX_FD != -1 to use that value.
3438
MAX_FD="maximum"
@@ -66,6 +70,7 @@ esac
6670

6771
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6872

73+
6974
# Determine the Java command to use to start the JVM.
7075
if [ -n "$JAVA_HOME" ] ; then
7176
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -109,10 +114,11 @@ if $darwin; then
109114
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110115
fi
111116

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
117+
# For Cygwin or MSYS, switch paths to Windows format before running java
118+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114119
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115120
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
121+
116122
JAVACMD=`cygpath --unix "$JAVACMD"`
117123

118124
# We build the pattern for arguments to be converted via cygpath
@@ -138,19 +144,19 @@ if $cygwin ; then
138144
else
139145
eval `echo args$i`="\"$arg\""
140146
fi
141-
i=$((i+1))
147+
i=`expr $i + 1`
142148
done
143149
case $i in
144-
(0) set -- ;;
145-
(1) set -- "$args0" ;;
146-
(2) set -- "$args0" "$args1" ;;
147-
(3) set -- "$args0" "$args1" "$args2" ;;
148-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150+
0) set -- ;;
151+
1) set -- "$args0" ;;
152+
2) set -- "$args0" "$args1" ;;
153+
3) set -- "$args0" "$args1" "$args2" ;;
154+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
155+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
156+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
157+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
158+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
159+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154160
esac
155161
fi
156162

@@ -159,14 +165,9 @@ save () {
159165
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160166
echo " "
161167
}
162-
APP_ARGS=$(save "$@")
168+
APP_ARGS=`save "$@"`
163169

164170
# Collect all arguments for the java command, following the shell quoting and substitution rules
165171
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166172

167-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169-
cd "$(dirname "$0")"
170-
fi
171-
172173
exec "$JAVACMD" "$@"

gradlew.bat

+24-19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
1329
set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
1635
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
36+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1837

1938
@rem Find java.exe
2039
if defined JAVA_HOME goto findJavaFromJavaHome
2140

2241
set JAVA_EXE=java.exe
2342
%JAVA_EXE% -version >NUL 2>&1
24-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
2544

2645
echo.
2746
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -35,7 +54,7 @@ goto fail
3554
set JAVA_HOME=%JAVA_HOME:"=%
3655
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
3756

38-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
3958

4059
echo.
4160
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -45,28 +64,14 @@ echo location of your Java installation.
4564

4665
goto fail
4766

48-
:init
49-
@rem Get command-line arguments, handling Windows variants
50-
51-
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
53-
:win9xME_args
54-
@rem Slurp the command line arguments.
55-
set CMD_LINE_ARGS=
56-
set _SKIP=2
57-
58-
:win9xME_args_slurp
59-
if "x%~1" == "x" goto execute
60-
61-
set CMD_LINE_ARGS=%*
62-
6367
:execute
6468
@rem Setup the command line
6569

6670
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
6771

72+
6873
@rem Execute Gradle
69-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
7075

7176
:end
7277
@rem End local scope for the variables with windows NT shell

ui/kotlinx-coroutines-android/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ configurations {
1010
create("r8")
1111
}
1212

13+
repositories {
14+
mavenCentral()
15+
jcenter() // https://youtrack.jetbrains.com/issue/IDEA-261387
16+
}
1317
dependencies {
1418
compileOnly("com.google.android:android:${version("android")}")
1519
compileOnly("androidx.annotation:annotation:${version("androidx_annotation")}")

0 commit comments

Comments
 (0)