Skip to content

Commit

Permalink
Simplify access to current project's members
Browse files Browse the repository at this point in the history
there's no need to explicitly use `project.` to get the current
project when that project is already a Kotlin implicit receiver.
  • Loading branch information
liblit committed Jan 15, 2024
1 parent b2f7fc7 commit a153f4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repositories {
java.toolchain.languageVersion =
JavaLanguageVersion.of(property("com.ibm.wala.jdk-version") as String)

base.archivesName = "com.ibm.wala${project.path.replace(':', '.')}"
base.archivesName = "com.ibm.wala${path.replace(':', '.')}"

configurations {
resolvable("ecj")
Expand Down Expand Up @@ -135,15 +135,15 @@ tasks.named<Test>("test") {
}
}

if (project.hasProperty("excludeSlowTests")) {
if (hasProperty("excludeSlowTests")) {
dependencies { testImplementation(testFixtures(project(":core"))) }
tasks.named<Test>("test") { useJUnitPlatform { excludeTags("slow") } }
}

val ecjCompileTaskProviders =
sourceSets.map { sourceSet -> JavaCompileUsingEcj.withSourceSet(project, sourceSet) }

project.tasks.named("check") { dependsOn(ecjCompileTaskProviders) }
tasks.named("check") { dependsOn(ecjCompileTaskProviders) }

tasks.withType<JavaCompile>().configureEach {
options.run {
Expand Down Expand Up @@ -172,7 +172,7 @@ tasks.withType<JavaCompileUsingEcj>().configureEach {
// fixtures, we extend the main sourceSet to include all
// test-fixture sources too. This hack is only applied when
// WALA itself is an included build.
if (project.gradle.parent != null) {
if (gradle.parent != null) {
afterEvaluate {
sourceSets["main"].java.srcDirs(sourceSets["testFixtures"].java.srcDirs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ val mavenPublication =
}

pom {
name = project.properties["POM_NAME"] as String
name = property("POM_NAME") as String
description = "T. J. Watson Libraries for Analysis"
inceptionYear = "2006"
url = "https://github.com/wala/WALA"
Expand Down Expand Up @@ -128,17 +128,17 @@ val mavenRepository: MavenArtifactRepository =
url =
uri(
(if (isSnapshot)
project.properties.getOrDefault(
properties.getOrDefault(
"SNAPSHOT_REPOSITORY_URL",
"https://oss.sonatype.org/content/repositories/snapshots/")
else
project.properties.getOrDefault(
properties.getOrDefault(
"RELEASE_REPOSITORY_URL",
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"))
as String)
credentials {
username = project.properties["SONATYPE_NEXUS_USERNAME"] as String?
password = project.properties["SONATYPE_NEXUS_PASSWORD"] as String?
username = properties["SONATYPE_NEXUS_USERNAME"] as String?
password = properties["SONATYPE_NEXUS_PASSWORD"] as String?
}
}

Expand Down

0 comments on commit a153f4c

Please sign in to comment.