# File lib/buildr/scala/compiler.rb, line 31
    def installed_version
      unless @installed_version
        @installed_version = if Scalac.installed?
          begin
            # try to read the value from the properties file
            props = Zip::ZipFile.open(File.expand_path('lib/scala-library.jar', Scalac.scala_home)) do |zipfile|
              zipfile.read 'library.properties'
            end

            version_str = props.match(/version\.number\s*=\s*([^\s]+)/).to_a[1]

            if version_str
              md = version_str.match(/\d+\.\d[\d\.]*/) or
                fail "Unable to parse Scala version: #{version_str}"

              md[0].sub(/.$/, "") # remove trailing dot, if any
            end
          rescue => e
            warn "Unable to parse library.properties in $SCALA_HOME/lib/scala-library.jar: #{e}"
            nil
          end
        end
      end

      @installed_version
    end