kotlin icon indicating copy to clipboard operation
kotlin copied to clipboard

Alternative install for macOS

Open muellnes opened this issue 3 years ago • 5 comments

Our macOS environment is restricted from using home-brew. Is there an alternative way to install danger-kotlin on macOS?

muellnes avatar Jun 01 '22 07:06 muellnes

Hey 👋🏻 Have you tried

bash <(curl -s https://raw.githubusercontent.com/danger/kotlin/master/scripts/install.sh)
source ~/.bash_profile

?

f-meloni avatar Jun 01 '22 07:06 f-meloni

Whoosh thanks for your quick response. This is another issue, we do not have administrator access on most of the machines, developers are assigned to the _developer group

sudo dscl . append /Groups/_developer GroupMembership <username>

which is usually enough for us.

So the install.sh way did not sadly work out as expected:

checkdir error:  cannot create /usr/local/kotlinc
                 Permission denied

muellnes avatar Jun 01 '22 08:06 muellnes

🤔

https://github.com/danger/kotlin/blob/master/scripts/install.sh#L33-L48 if you install koltinc and gradle yourself it shouldn't try to install those during the script, so that might avoid that issue

f-meloni avatar Jun 01 '22 08:06 f-meloni

Perfect I will verify, why it could not find it in the path.

BTW: Did you thought about using ~/.profile instead of the shell specific profile for initialisation?

muellnes avatar Jun 01 '22 08:06 muellnes

Also faced with the problem. In my case I do the next steps to install kotlin-danger on Mac OS:

  1. git clone https://github.com/danger/kotlin.git --branch 1.2.0 --depth 1 _danger-kotlin
  2. cd _danger-kotlin
  3. Find a directory with JDK 17 with command /usr/libexec/java_home -v 17
  4. Open to edit Makefile
  5. Add in the top of Make file line like export JAVA_HOME=/path/from/step3
  6. Run make install

During the installation I also faced with two another troubles:

  1. It was unable to install libffi. So I just installed it manually with command brew install libffi
  2. I got an error ld: unknown options: -sdk-version. As I know this error occurs on Mac OS after update xCode to version 15. To fix it I found the executable() string in file danger-kotlin/build.gradle.kts and replace it with the code below:
executable {
     linkerOpts += "-ld64"
}

bartwell avatar Dec 09 '23 15:12 bartwell