|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +require_relative 'spec_helper' |
| 4 | + |
| 5 | +RSpec.describe 'Gradle buildpack detection' do |
| 6 | + it 'shows helpful error message when no Gradle project files are found' do |
| 7 | + app = Hatchet::Runner.new('non-gradle-app', allow_failure: true) |
| 8 | + app.deploy do |
| 9 | + expect(clean_output(app.output)).to include(<<~OUTPUT) |
| 10 | + remote: ! Error: Your app is configured to use the Gradle buildpack, |
| 11 | + remote: ! but we couldn't find any supported Gradle project files. |
| 12 | + remote: ! |
| 13 | + remote: ! The Gradle buildpack requires at least one of the following files |
| 14 | + remote: ! in the root directory of your source code: |
| 15 | + remote: ! |
| 16 | + remote: ! Supported Gradle files: gradlew, build.gradle, build.gradle.kts, settings.gradle, settings.gradle.kts |
| 17 | + remote: ! |
| 18 | + remote: ! IMPORTANT: If your project uses a different build tool: |
| 19 | + remote: ! - For Maven projects, use the heroku/java buildpack instead |
| 20 | + remote: ! - For sbt projects, use the heroku/scala buildpack instead |
| 21 | + remote: ! |
| 22 | + remote: ! Currently the root directory of your app contains: |
| 23 | + remote: ! |
| 24 | + remote: ! README.md |
| 25 | + remote: ! |
| 26 | + remote: ! If your app already has Gradle files, check that they: |
| 27 | + remote: ! |
| 28 | + remote: ! 1. Are in the top level directory (not a subdirectory). |
| 29 | + remote: ! 2. Have the correct spelling (the filenames are case-sensitive). |
| 30 | + remote: ! 3. Aren't listed in '.gitignore' or '.slugignore'. |
| 31 | + remote: ! 4. Have been added to the Git repository using 'git add --all' |
| 32 | + remote: ! and then committed using 'git commit'. |
| 33 | + remote: ! |
| 34 | + remote: ! For help with using Gradle on Heroku, see: |
| 35 | + remote: ! https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku |
| 36 | + OUTPUT |
| 37 | + end |
| 38 | + end |
| 39 | +end |
0 commit comments