Update to gradle 6.3 and kotlin 1.3.72#45
Update to gradle 6.3 and kotlin 1.3.72#45marshallpierce wants to merge 1 commit intonpryce:masterfrom
Conversation
76529b3 to
3f3ad3b
Compare
3f3ad3b to
8870623
Compare
| .idea/modules.xml | ||
| .idea/.name | ||
| .idea/compiler.xml | ||
| .idea/workspace.xml |
There was a problem hiding this comment.
My IDE wanted to add even more files, and also was having a slapfight with your IDE over the ones that were checked in. In my experience, having anything in .idea in VCS leads to discomfort.
There was a problem hiding this comment.
For convenience .idea (and all constantly ignored files and folders) should be included in a global .gitignore file in the user home directory and be declared like this:
git config --global core.excludesFile '~/.gitignore'
There was a problem hiding this comment.
That's one way of doing it, I suppose, but in my experience, the more behavior you can sqeeze into the repo itself, the better. I want to know that every clone of this repo will have the same ignored files the same way that I want them to all have the same source code.
| println("building version $version") | ||
|
|
||
| repositories { | ||
| mavenCentral() |
There was a problem hiding this comment.
the buildscript repositories block was using jcenter(), which is a superset of mavenCentral(), but this one wasn't, so I left it as such
| } | ||
|
|
||
| dependencies { | ||
| implementation(kotlin("stdlib")) |
There was a problem hiding this comment.
the previous setup was using compileOnly, which seems improbable, as the project is using non-inlined elements of the kotlin stdlib. Similarly, kotlin-reflect also looks like it's used at runtime.
| } | ||
|
|
||
| java { | ||
| withSourcesJar() |
There was a problem hiding this comment.
new shortcut in recent gradle
| } | ||
|
|
||
|
|
||
| task javadocJar(type: Jar) { |
There was a problem hiding this comment.
This was likely copied from another build -- it produced empty jars. Not too hard to set up kdoc to do something similar, but given that you've made it this far (and most people will just use the source jar anyway), probably fine without.
On master:
% gw clean javadocJar
Parallel execution is an incubating feature.
> Configure project :
building version SNAPSHOT
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_d5evhdqlezgzanmdvjnd6czsd.run(/vol/ssd-2/mbp-home/dev/forks/konfig/build.gradle:84)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed
% find . -name '*.jar'
./gradle/wrapper/gradle-wrapper.jar
./build/libs/konfig-SNAPSHOT-javadoc.jar
% jar -tf build/libs/konfig-SNAPSHOT-javadoc.jar
META-INF/
META-INF/MANIFEST.MF
| val shortOpts: Map<String, CommandLineOption> = options.filter { it.short != null }.associateBy({ "-${it.short!!}" }, { it }) | ||
| val longOpts: Map<String, CommandLineOption> = options.associateBy({ "--${it.long}" }, { it }) | ||
| var i = 0; |
There was a problem hiding this comment.
Sorry for the whitespace noise. I gave up trying to get IntelliJ to not fix it. This line is the warning I had it fix.
| private fun outer() = outer ?: javaClass.enclosingClass?.kotlin?.objectInstance as? PropertyGroup | ||
| private fun name() : String = namePrefix() + groupName() | ||
| private fun namePrefix() = outer()?.name()?.let { it + "." } ?: "" | ||
| private fun namePrefix() = outer()?.name()?.let { "$it." } ?: "" |
There was a problem hiding this comment.
More letting the IDE apply its suggestions.
|
|
||
| fun <T : Enum<T>> enumType(enumClass: Class<T>, allowed: Iterable<T>) = enumType(enumClass, allowed.associate { it.name to it }) | ||
| fun <T : Enum<T>> enumType(enumClass: Class<T>, allowed: Iterable<T>) = enumType(enumClass, | ||
| allowed.associateBy { it.name }) |
There was a problem hiding this comment.
and more accepting the IDE's suggestions. Here, no Pair need be allocated by using associateBy instead of associate.
|
|
||
| jdk: | ||
| - oraclejdk8 | ||
| - oraclejdk11 |
There was a problem hiding this comment.
Travis grumbles about 8, so figured we might as well have the LTS and the latest 6-mo release.
|
|
||
| // anonymous objects don't get names in their KClass, so we have to resort to the JVM's name | ||
| private fun groupName() = javaClass.kotlin.simpleName?.substringBefore("$") | ||
| ?: javaClass.name.split("$").let { chunks -> |
There was a problem hiding this comment.
turns out simpleName (and the other names in KClass) were documented to be null for anonymous objects, but happened to be non-null before. Now they are null, so this will fall back to attempting to parse Class.getName() before giving up.
No description provided.