Class AppNameResolver


  • public class AppNameResolver
    extends Object
    • Constructor Detail

      • AppNameResolver

        public AppNameResolver()
    • Method Detail

      • resolve

        public static Optional<String> resolve​(Path projectDirectory,
                                               Supplier<Optional<String>> customResolver)
                                        throws IOException
        Resolves the Heroku app name based on the given project directory. This uses the already established resolution order from 2.x to ensure backwards compatibility: 1. The heroku.properties file 2. The heroku.appName system property 3. Custom resolution 4. Git remote pointing to an Heroku app
        Parameters:
        projectDirectory - The projects root directory.
        customResolver - A custom resolver for the app name. Most likely a setting from a build tool like Maven or sbt.
        Returns:
        If possible, the resolved app name.
        Throws:
        IOException - Resolving requires IO operations which might fail.