Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Kobalt 0.633 (new formula) #49392

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Library/Formula/kobalt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class Kobalt < Formula
desc "Build system"
homepage "http://beust.com/kobalt"
url "https://github.com/cbeust/kobalt/releases/download/0.633/kobalt-0.633.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw this URL: we need to build from source.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying that when someone installs Kobalt, you will build it from the source and then install the resulting binaries? (sorry if it's a silly question, I'm not very familiar with Homebrew's internals)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The exception we make is if this is Java code; it's OK for us to not build from source there because the "binaries" work cross-platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kobalt is written in Kotlin actually but same thing: the zip file contains a jar which is cross platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆒

sha256 "bb468a7b8761de20c4700e18a6de55ee0712edd0e9d04748e53592c91389c94e"

def install
libexec.install %w[kobaltw kobalt]
kobaltw = libexec/"kobaltw"
kobaltw.chmod 0755
bin.write_exec_script kobaltw
end

test do
ENV.java_cache

(testpath/"src/main/kotlin/com/A.kt").write <<-EOS.undent
package com
class A
EOS

(testpath/"kobalt/src/Build.kt").write <<-EOS.undent
import com.beust.kobalt.*
import com.beust.kobalt.api.*
import com.beust.kobalt.plugin.packaging.*

val p = project {
name = "test"
version = "1.0"
assemble {
jar {}
}
}
EOS

system "#{bin}/kobaltw", "assemble"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trying to write to the wrong $HOME: http://bot.brew.sh/job/Homebrew%20Pull%20Requests/42192/version=el_capitan/testReport/junit/brew-test-bot/el_capitan/test_kobalt/

Add a ENV.java_cache line to test do which should fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

output = "kobaltBuild/libs/test-1.0.jar"
assert File.exist?(output), "Couldn't find #{output}"
end
end