mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 02:55:23 +02:00
Require Java 8 from now on
This commit is contained in:
@@ -2,6 +2,7 @@ package coursier
|
||||
package cli
|
||||
|
||||
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, File, FileInputStream, IOException}
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.attribute.PosixFilePermission
|
||||
import java.util.Properties
|
||||
@@ -156,7 +157,7 @@ object Bootstrap extends CaseApp[BootstrapOptions] {
|
||||
entry.setTime(time)
|
||||
|
||||
outputZip.putNextEntry(entry)
|
||||
outputZip.write(content.getBytes("UTF-8"))
|
||||
outputZip.write(content.getBytes(UTF_8))
|
||||
outputZip.closeEntry()
|
||||
}
|
||||
|
||||
@@ -207,7 +208,7 @@ object Bootstrap extends CaseApp[BootstrapOptions] {
|
||||
"exec java -jar " + options.options.javaOpt.map(s => "'" + s.replace("'", "\\'") + "'").mkString(" ") + " \"$0\" \"$@\""
|
||||
).mkString("", "\n", "\n")
|
||||
|
||||
try FileUtil.write(output0, shellPreamble.getBytes("UTF-8") ++ buffer.toByteArray)
|
||||
try FileUtil.write(output0, shellPreamble.getBytes(UTF_8) ++ buffer.toByteArray)
|
||||
catch { case e: IOException =>
|
||||
Console.err.println(s"Error while writing $output0${Option(e.getMessage).fold("")(" (" + _ + ")")}")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package coursier.cli
|
||||
|
||||
import java.io.{BufferedReader, File, InputStream, InputStreamReader, PipedInputStream, PipedOutputStream, PrintStream}
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
|
||||
import coursier.internal.FileUtil
|
||||
|
||||
@@ -55,7 +56,7 @@ object SparkOutputHelper {
|
||||
if (!written) {
|
||||
println(s"Detected YARN app ID $id")
|
||||
Option(yarnAppFile.getParentFile).foreach(_.mkdirs())
|
||||
FileUtil.write(yarnAppFile, id.getBytes("UTF-8"))
|
||||
FileUtil.write(yarnAppFile, id.getBytes(UTF_8))
|
||||
written = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package coursier.cli.spark
|
||||
|
||||
import java.io.{File, FileInputStream, FileOutputStream}
|
||||
import java.math.BigInteger
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import java.nio.file.{Files, StandardCopyOption}
|
||||
import java.security.MessageDigest
|
||||
import java.util.jar.{Attributes, JarFile, JarOutputStream, Manifest}
|
||||
import java.util.regex.Pattern
|
||||
@@ -207,7 +209,7 @@ object Assembly {
|
||||
extraDependencies: Seq[String],
|
||||
options: CommonOptions,
|
||||
artifactTypes: Set[String],
|
||||
checksumSeed: Array[Byte] = "v1".getBytes("UTF-8")
|
||||
checksumSeed: Array[Byte] = "v1".getBytes(UTF_8)
|
||||
): Either[String, (File, Seq[File])] = {
|
||||
|
||||
val helper = sparkJarsHelper(scalaVersion, sparkVersion, yarnVersion, default, extraDependencies, options)
|
||||
@@ -240,7 +242,7 @@ object Assembly {
|
||||
md.update(checksumSeed)
|
||||
|
||||
for (c <- checksums.sorted) {
|
||||
val b = c.getBytes("UTF-8")
|
||||
val b = c.getBytes(UTF_8)
|
||||
md.update(b, 0, b.length)
|
||||
}
|
||||
|
||||
@@ -271,7 +273,7 @@ object Assembly {
|
||||
val tmpDest = new File(dest.getParentFile, s".${dest.getName}.part")
|
||||
// FIXME Acquire lock on tmpDest
|
||||
Assembly.make(jars, tmpDest, assemblyRules)
|
||||
FileUtil.atomicMove(tmpDest, dest)
|
||||
Files.move(tmpDest.toPath, dest.toPath, StandardCopyOption.ATOMIC_MOVE)
|
||||
Right((dest, jars))
|
||||
}.left.map(_.describe)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package coursier.cli
|
||||
|
||||
import java.io._
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import java.util.zip.ZipInputStream
|
||||
|
||||
import caseapp.core.RemainingArgs
|
||||
@@ -69,7 +70,7 @@ class CliBootstrapIntegrationTest extends FlatSpec with CliTestLib {
|
||||
|
||||
val zis = new ZipInputStream(new ByteArrayInputStream(actualContent))
|
||||
|
||||
val lines = new String(zipEntryContent(zis, "bootstrap-isolation-foo-jar-urls"), "UTF-8").lines.toVector
|
||||
val lines = new String(zipEntryContent(zis, "bootstrap-isolation-foo-jar-urls"), UTF_8).lines.toVector
|
||||
|
||||
val extensions = lines
|
||||
.map { l =>
|
||||
|
||||
Reference in New Issue
Block a user