Skip to content

Commit

Permalink
buildSrc is now a submodule
Browse files Browse the repository at this point in the history
upgrade several dependencies
  • Loading branch information
tribbloid committed Dec 6, 2023
1 parent 3264321 commit 056789d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 259 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "prover-commons"]
path = prover-commons
url = https://github.com/tribbloid/prover-commons
[submodule "buildSrc"]
path = buildSrc
url = https://github.com/tribbloid/buildSrc
261 changes: 8 additions & 253 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,274 +1,38 @@
val vs = versions()

buildscript {
repositories {
// Add here whatever repositories you're already using
mavenCentral()
}

// val vs = versions()

dependencies {
classpath("ch.epfl.scala:gradle-bloop_2.12:1.6.0") // suffix is always 2.12, weird
classpath("ch.epfl.scala:gradle-bloop_2.12:1.6.2") // suffix is always 2.12, weird
}
}

plugins {
// base
java
`java-library`
`java-test-fixtures`

scala
id("io.github.cosmicsilence.scalafix") version "0.1.14"
// kotlin("jvm") version "1.6.10" // TODO: remove?

idea

signing
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"

id("com.github.ben-manes.versions") version "0.44.0"
id("ai.acyclic.scala2-conventions")
id("ai.acyclic.publish-conventions")
}

val sonatypeApiUser = providers.gradleProperty("sonatypeApiUser")
val sonatypeApiKey = providers.gradleProperty("sonatypeApiKey")
if (sonatypeApiUser.isPresent && sonatypeApiKey.isPresent) {
nexusPublishing {
repositories {
sonatype {

nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

username.set(sonatypeApiUser)
password.set(sonatypeApiKey)
useStaging.set(true)
}
}
}
} else {
logger.warn("Sonatype API credential not defined, skipping ...")
}
val vs = versions()
val shapelessV = "2.3.9"

allprojects {

apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "java-test-fixtures")


// apply(plugin = "bloop")
// DO NOT enable! In VSCode it will cause the conflict:
// Cannot add extension with name 'bloop', as there is an extension already registered with that name

apply(plugin = "scala")
apply(plugin = "io.github.cosmicsilence.scalafix")
// apply(plugin = "kotlin")

apply(plugin = "idea")

apply(plugin = "signing")
apply(plugin = "maven-publish")

group = vs.projectGroup
version = vs.projectV

repositories {
mavenLocal()
mavenCentral()
// jcenter()
maven("https://dl.bintray.com/kotlin/kotlin-dev")
maven("https://scala-ci.typesafe.com/artifactory/scala-integration/") // scala SNAPSHOT
}

task("dependencyTree") {

dependsOn("dependencies")
}

tasks {

withType<ScalaCompile> {

// targetCompatibility = jvmTarget

scalaCompileOptions.apply {

loggingLevel = "verbose"

val compilerOptions =

mutableListOf(

"-encoding", "UTF-8",
"-unchecked", "-deprecation", "-feature",

"-language:higherKinds",

"-Xlint:poly-implicit-overload", "-Xlint:option-implicit", "-Wunused:imports",

"-g:vars",

// "-Ylog",
// "-Ydebug",

// ,
// "-Xlog-implicits",
// "-Xlog-implicit-conversions",
// "-Xlint:implicit-not-found",
// "-Xlint:implicit-recursion"
)

if (vs.splainV.isNotEmpty()) {
compilerOptions.addAll(
listOf(
"-Vimplicits", "-Vimplicits-verbose-tree", "-Vtype-diffs"
)
)
}

additionalParameters = compilerOptions

forkOptions.apply {

memoryInitialSize = "1g"
memoryMaximumSize = "4g"

// this may be over the top but the test code in macro & core frequently run implicit search on church encoded Nat type
jvmArgs = listOf(
"-Xss256m"
)
}
}
}

test {

minHeapSize = "1024m"
maxHeapSize = "4096m"

testLogging {

showExceptions = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL

showCauses = true
showStackTraces = true

// stdout is used for occasional manual verification
showStandardStreams = true
}

useJUnitPlatform {
includeEngines("scalatest")
testLogging {
events("passed", "skipped", "failed")
}
}
}
}

java {
withSourcesJar()
withJavadocJar()
}

idea {

module {

excludeDirs = excludeDirs + files(

"target",
"out",
"build",

".idea",
".vscode",
".bloop",
".bsp",
".metals",
"bin",

".ammonite",

"logs",

)

isDownloadJavadoc = true
isDownloadSources = true
}
}

dependencies {

// see https://github.com/gradle/gradle/issues/13067
// TODO: remove, apparently fixed in the latest plugin
// fun bothImpl(constraintNotation: Any) {
// implementation(constraintNotation)
// testFixturesImplementation(constraintNotation)
// }

constraints {
implementation("com.chuusai:shapeless_${vs.scala.binaryV}:${vs.shapelessV}")
}

implementation("${vs.scala.group}:scala-compiler:${vs.scala.v}")
implementation("${vs.scala.group}:scala-library:${vs.scala.v}")
implementation("${vs.scala.group}:scala-reflect:${vs.scala.v}")

testFixturesApi("org.scalatest:scalatest_${vs.scala.binaryV}:${vs.scalaTestV}")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")

// TODO: alpha project, switch to mature solution once https://github.com/scalatest/scalatest/issues/1454 is solved
testRuntimeOnly("co.helmethair:scalatest-junit-runner:0.2.0")

// testRuntimeOnly("com.vladsch.flexmark:flexmark-all:0.35.10")
//https://github.com/tek/splain
if (vs.splainV.isNotEmpty()) {
val splainD = "io.tryp:splain_${vs.scala.v}:${vs.splainV}"
logger.warn("Using " + splainD)

scalaCompilerPlugins(splainD)
implementation("com.chuusai:shapeless_${vs.scala.binaryV}:${shapelessV}")
}
}
}

subprojects {

// resolving version conflicts
// TODO: remove, already defined in `constraints` as below
// configurations.all {
// resolutionStrategy.dependencySubstitution {
// substitute(
// module("com.chuusai:shapeless_${vs.scala.binaryV}")
// ).apply {
// using(module("com.chuusai:shapeless_${vs.scala.binaryV}:${vs.shapelessV}"))
// }
// }
// }

// https://stackoverflow.com/a/66352905/1772342
val signingSecretKey = providers.gradleProperty("signing.gnupg.secretKey")
val signingKeyPassphrase = providers.gradleProperty("signing.gnupg.passphrase")
signing {
useGpgCmd()
if (signingSecretKey.isPresent) {
useInMemoryPgpKeys(signingSecretKey.get(), signingKeyPassphrase.get())
// useInMemoryPgpKeys(signingKeyID.get(), signingSecretKey.get(), signingKeyPassphrase.get())
sign(extensions.getByType<PublishingExtension>().publications)
} else {
logger.warn("PGP signing key not defined, skipping ...")
}
}

publishing {
val suffix = "_" + vs.scala.binaryV

val rootID = vs.projectRootID
val rootID = vs.rootID

val moduleID =
if (project.name.equals(rootID)) throw UnsupportedOperationException("root project should not be published")
Expand All @@ -279,15 +43,8 @@ subprojects {
if (whitelist.contains(project.name)) {

publications {
create<MavenPublication>("maven") {
artifactId = moduleID

val javaComponent = components["java"] as AdhocComponentWithVariants
from(javaComponent)

javaComponent.withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() }
javaComponent.withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }

withType<MavenPublication> {

pom {
licenses {
Expand Down Expand Up @@ -330,8 +87,6 @@ idea {
module {

excludeDirs = excludeDirs + files(
".gradle",

// apache spark
"warehouse",

Expand Down
2 changes: 1 addition & 1 deletion dev/gradle-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ FWDIR="$(
pwd
)"

${FWDIR}/gradlew wrapper --gradle-version=8.1.1
${FWDIR}/gradlew wrapper --gradle-version=8.5

${FWDIR}/gradlew dependencyUpdates --warning-mode all "$@"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scalaGroup=org.scala-lang

#scalaVersion=2.12.12
scalaVersion=2.13.10
scalaVersion=2.13.12

#noDemo
#noVerify
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion prover-commons
Submodule prover-commons updated 71 files
+2 −1 .gitattribute
+2 −2 .github/workflows/CI-latest.yml
+4 −1 .gitignore
+3 −0 .gitmodules
+25 −0 .scalafix.conf
+7 −4 .scalafmt.conf
+4 −2 README.md
+2 −162 build.gradle.kts
+1 −0 buildSrc
+0 −9 buildSrc/build.gradle.kts
+0 −21 buildSrc/src/main/kotlin/Versions.kt
+0 −9 buildSrc/src/main/kotlin/init.kt
+0 −11 dev/.CI.sh
+10 −0 dev/CI-latest-splain.sh
+2 −2 dev/CI-latest.sh
+9 −0 dev/CI/main.sh
+10 −0 dev/CI/pipeline.sh
+1 −1 dev/gradle-versions.sh
+7 −0 dev/update-submodules.sh
+15 −0 doc/INCOMPLETE induction?.md
+5 −1 gradle.properties
+ gradle/wrapper/gradle-wrapper.jar
+2 −1 gradle/wrapper/gradle-wrapper.properties
+6 −2 gradlew
+92 −92 gradlew.bat
+0 −15 module/build.gradle.kts
+9 −2 module/core/build.gradle.kts
+1 −5 module/core/src/main/scala/ai/acyclic/prover/commons/EqualBy.scala
+6 −6 module/core/src/main/scala/ai/acyclic/prover/commons/Same.scala
+67 −0 module/core/src/main/scala/ai/acyclic/prover/commons/__Glossary.scala
+36 −0 module/core/src/main/scala/ai/acyclic/prover/commons/__ImplicitSearchOrder.scala
+1 −1 module/core/src/main/scala/ai/acyclic/prover/commons/debug/Debug.scala
+7 −7 module/core/src/main/scala/ai/acyclic/prover/commons/diff/StringDiff.scala
+126 −101 module/core/src/main/scala/ai/acyclic/prover/commons/graph/Engine.scala
+9 −7 module/core/src/main/scala/ai/acyclic/prover/commons/graph/GraphK.scala
+0 −9 module/core/src/main/scala/ai/acyclic/prover/commons/graph/Law.scala
+0 −20 module/core/src/main/scala/ai/acyclic/prover/commons/graph/Lawful.scala
+17 −18 module/core/src/main/scala/ai/acyclic/prover/commons/graph/NodeK.scala
+7 −5 module/core/src/main/scala/ai/acyclic/prover/commons/graph/RewriterK.scala
+0 −87 module/core/src/main/scala/ai/acyclic/prover/commons/graph/Topology.scala
+3 −3 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/Local.scala
+16 −9 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/LocalEngine.scala
+2 −2 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/ops/AnyGraphBinary.scala
+51 −57 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/ops/AnyGraphUnary.scala
+5 −3 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/ops/OutboundGraphUnary.scala
+8 −6 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/ops/UpperSemilatticeUnary.scala
+3 −2 module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/package.scala
+73 −0 module/core/src/main/scala/ai/acyclic/prover/commons/graph/topology/Axiom.scala
+60 −0 module/core/src/main/scala/ai/acyclic/prover/commons/graph/topology/Lawful.scala
+19 −0 module/core/src/main/scala/ai/acyclic/prover/commons/graph/topology/Topology.scala
+10 −16 module/core/src/main/scala/ai/acyclic/prover/commons/graph/viz/Flow.scala
+4 −3 module/core/src/main/scala/ai/acyclic/prover/commons/graph/viz/Hierarchy.scala
+4 −6 module/core/src/main/scala/ai/acyclic/prover/commons/graph/viz/LinkedHierarchy.scala
+1 −51 module/core/src/main/scala/ai/acyclic/prover/commons/package.scala
+4 −4 module/core/src/main/scala/ai/acyclic/prover/commons/typesetting/Padding.scala
+29 −0 module/core/src/main/scala/ai/acyclic/prover/commons/util/Summoner.scala
+0 −32 module/core/src/main/scala/ai/acyclic/prover/commons/util/util.scala
+35 −0 module/core/src/main/scala/spike/Spike.scala
+3 −6 module/core/src/test/scala/ai/acyclic/prover/commons/graph/local/ops/AnyGraphUnarySpec.scala
+2 −2 module/core/src/test/scala/ai/acyclic/prover/commons/graph/viz/FlowSpec.scala
+9 −9 module/core/src/test/scala/ai/acyclic/prover/commons/graph/viz/HierarchySpec.scala
+12 −12 module/core/src/test/scala/ai/acyclic/prover/commons/graph/viz/LinkedHierarchySpec.scala
+1 −1 module/core/src/testFixtures/scala/ai/acyclic/prover/commons/testlib/BaseSpec.scala
+0 −6 module/meta2/build.gradle.kts
+1 −3 module/meta2/src/main/scala/ai/acyclic/prover/commons/meta2/format/Formats1.scala
+0 −1 module/meta2/src/main/scala/ai/acyclic/prover/commons/viz/TypeOfMixin.scala
+1 −1 module/meta2/src/test/scala/ai/acyclic/prover/commons/meta2/format/BacktrackingDummy.scala
+0 −6 notebook/build.gradle.kts
+41 −0 notebook/src/test/scala/ai/acyclic/prover/commons/notebook/ForwardPlot.scala
+1 −37 notebook/src/test/scala/ai/acyclic/prover/commons/notebook/PathToDOT.scala
+36 −0 notebook/src/test/scala/ai/acyclic/prover/commons/notebook/SplainPluginVersions.scala
2 changes: 1 addition & 1 deletion splain
Submodule splain updated 181 files
2 changes: 1 addition & 1 deletion verify/djl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ dependencies {
testImplementation(testFixtures(project(":verify")))

// TODO: the following are too specialised and should only be used in testing
api("ai.djl.pytorch:pytorch-engine:0.22.1")
api("ai.djl.pytorch:pytorch-engine:0.25.0")
api("ai.djl.pytorch:pytorch-native-auto:1.9.1")
}

0 comments on commit 056789d

Please sign in to comment.