Skip to content

Commit

Permalink
fix: add @throws on DependenciesSimplifier factories.
Browse files Browse the repository at this point in the history
  • Loading branch information
autonomousapps committed Dec 4, 2024
1 parent 703673b commit 4fa1f3e
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,32 @@ public class DependenciesSimplifier private constructor(
}

public companion object {
/**
* Returns a [DependenciesSimplifier], which eagerly parses [buildScript].
*
* @throws IllegalStateException if [DependencyExtractor] sees an expression it doesn't understand.
*/
@Throws(IllegalStateException::class)
public fun of(buildScript: Path): DependenciesSimplifier {
return of(Parser.readOnlyInputStream(buildScript))
}

/**
* Returns a [DependenciesSimplifier], which eagerly parses [buildScript].
*
* @throws IllegalStateException if [DependencyExtractor] sees an expression it doesn't understand.
*/
@Throws(IllegalStateException::class)
public fun of(buildScript: String): DependenciesSimplifier {
return of(buildScript.byteInputStream())
}

/**
* Returns a [DependenciesSimplifier], which eagerly parses [buildScript].
*
* @throws IllegalStateException if [DependencyExtractor] sees an expression it doesn't understand.
*/
@Throws(IllegalStateException::class)
private fun of(buildScript: InputStream): DependenciesSimplifier {
val errorListener = CollectingErrorListener()

Expand Down

0 comments on commit 4fa1f3e

Please sign in to comment.