danger / kotlin

⚠️ Stop saying "you forgot to …" in code review
MIT License
505 stars 50 forks source link

Alternative install for macOS #225

Open muellnes opened 2 years ago

muellnes commented 2 years ago

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

f-meloni commented 2 years ago

Hey 👋🏻 Have you tried

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

?

muellnes commented 2 years ago

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
f-meloni commented 2 years ago

🤔

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

muellnes commented 2 years ago

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?

bartwell commented 11 months ago

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"
    }