GradleUp/magik

Some problems with setting up the plugin

Closed this issue · 3 comments

First of all, I am not that knowledgeable when it comes to gradle, so it is certainly possible that I have missed some things.

I tried using this plugin following the README file but came across two problems:

  1. Gradle is unable to build the project when using the alsoSnapshot() option
  2. Gradle is able to build but unable to publish when not using the alsoSnapshot() option

Some links:

  • Error log for the first problem
    • Line 31 is }.alsoSnapshot() // this clones the publication for snapshots
    • Following the stacktrace, magik most likely has a problem when running git describe --tags which outputs fatal: No names found, cannot describe anything. which it then attempts to parse to an int in the gitDistance function
    • Do I need tags for this to work? There is no mention in the README about that
  • Error log for the second problem
    • Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 52: https://api.github.com/repos/kwerber/abc/contents/de\kwerber\abc\0.1\abc-0.1.jar
    • The illegal character is the first \
  • build.gradle.kts for the first problem
  • build.gradle.kts for the second problem

Some additional information:

  • I am testing this plugin on my https://github.com/kwerber/abc repo (where commit 2 and 3 cause problems 1 and 2)
  • Gradle version 7.0.2
  • Java openjdk version "16.0.1" 2021-04-20
  • and git version 2.31.1.windows.1

Hey Kevin,

so, I pushed some additional logic which hopefully will help with your issues

  1. Now you don't need tags anymore for this to work, a -1 will be returned if this is the case.
    Moreover, now one can set whatever postfix he likes best by passing the ending lambda on alsoSnapshot, default is "+$gitDistance"

  2. Now all the backslashes will be switched with normal slashes, I haven't test this though

pull version 0.0.5

let me know if these help

Both issues seem to have been fixed, thanks!

Nice, thanks for reporting