Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.

Failing to compile build.gradle.kts does not fail the Gradle build #170

Closed
big-guy opened this issue Nov 2, 2016 · 4 comments
Closed

Failing to compile build.gradle.kts does not fail the Gradle build #170

big-guy opened this issue Nov 2, 2016 · 4 comments

Comments

@big-guy
Copy link
Member

big-guy commented Nov 2, 2016

Given a build.gradle.kts:

import org.gradle.api.*

task<DefaultTask>("broken)

Running gradle -b build.gradle.kts help produces:

Error: Expecting '"' (/Users/sterling/gits/tmp/kotlin/build.gradle.kts (3:27))
Error: Expecting ')' (/Users/sterling/gits/tmp/kotlin/build.gradle.kts (3:27))
:help

Welcome to Gradle 3.3-20161028185232+0000.

To run a build, run gradle ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task

BUILD SUCCESSFUL

Total time: 1.459 secs

I would expect this build to fail. If I look at gradle tasks, I see there's a task named broken).

@big-guy
Copy link
Member Author

big-guy commented Nov 2, 2016

And I should add, this isn't all types of failures. This is just one case I found. Other failures do cause build failures.

@bamboo
Copy link
Member

bamboo commented Nov 2, 2016

Curious :)

Thanks, @big-guy!

@mkobit
Copy link
Contributor

mkobit commented Feb 5, 2017

A few other weird examples with 0.7.0:

  1. Example version as second argument in kotlinModule
plugins {
  `lifecycle-base`
  `build-dashboard`
  java
}

dependencies {
  compile(kotlinModule("stdlib", ))
}

tasks {
  "wrapper"(Wrapper::class) {
    distributionUrl = "https://repo.gradle.org/gradle/dist-snapshots/gradle-script-kotlin-3.4-20170117200919+0000-all.zip"
  }
}

Results in:

./gradlew build
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib:1.1-M04 because no repositories are defined.
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.755 secs

  1. More contrived examples with a bunch of commas
plugins {
  `lifecycle-base`,,,,,,,,
  `build-dashboard`,,,,,
  java,,,
}

repositories {
  jcenter(),,,,
}
//

dependencies {
  compile(kotlinModule("stdlib", ))
}

tasks {
  "wrapper"(Wrapper::class) {
    distributionUrl = "https://repo.gradle.org/gradle/dist-snapshots/gradle-script-kotlin-3.4-20170117200919+0000-all.zip"
  }
}

@bamboo bamboo self-assigned this Mar 4, 2017
@bamboo bamboo modified the milestones: 0.8.0, 1.0.0 Mar 4, 2017
@bamboo
Copy link
Member

bamboo commented Mar 4, 2017

Resolved in 5682893.

@bamboo bamboo closed this as completed Mar 4, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants