-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
50 lines (39 loc) · 1.43 KB
/
build.sbt
File metadata and controls
50 lines (39 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.nio.file.Files
import sys.process._
val scala212 = "2.12.20"
ThisBuild / scalaVersion := scala212
ThisBuild / crossScalaVersions := Seq(scala212)
name := "codacy-github-graphql"
description := "Generated models and queries for GitHub v4 API in GraphQL"
val apolloVersion = IO
.readLines(file("gradle.properties"))
.find(_.startsWith("apolloVersion="))
.map(_.stripPrefix("apolloVersion="))
.getOrElse(
throw new Exception("missing apolloVersion property in gradle.properties")
)
libraryDependencies ++= Seq(
"com.apollographql.apollo" % "apollo-runtime" % apolloVersion
)
// Ensure Java 8 compatibility
javacOptions ++= Seq("--release", "8")
scalacOptions ++= Seq("-target:jvm-1.8")
Compile / sourceGenerators += Def.task {
val buildDir = baseDirectory.value / "build"
IO.delete(buildDir)
Seq("./gradlew", "generateMainGithubApolloSources").!
def listFiles(file: File): Seq[File] =
if (Files.isDirectory(file.toPath)) IO.listFiles(file).flatMap(listFiles)
else Seq(file)
listFiles(buildDir / "generated" / "source")
}.taskValue
homepage := Some(url("https://github.com/codacy/codacy-github-graphql"))
// HACK: This setting is not picked up properly from the plugin
pgpPassphrase := Option(System.getenv("SONATYPE_GPG_PASSPHRASE"))
.map(_.toCharArray)
scmInfo := Some(
ScmInfo(
url("https://github.com/codacy/codacy-github-graphql"),
"scm:git:git@github.com:codacy/codacy-github-graphql.git"
)
)