Skip to content

Commit

Permalink
Replaced JvmOverloads with new method
Browse files Browse the repository at this point in the history
  • Loading branch information
oldergod committed Jul 8, 2023
1 parent 12b56ba commit e73690e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion wire-schema-tests/api/wire-schema-tests.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ public final class com/squareup/wire/SchemaBuilder {
public fun <init> ()V
public final fun add (Lokio/Path;Ljava/lang/String;)Lcom/squareup/wire/SchemaBuilder;
public final fun add (Lokio/Path;Ljava/lang/String;Lokio/Path;)Lcom/squareup/wire/SchemaBuilder;
public static synthetic fun add$default (Lcom/squareup/wire/SchemaBuilder;Lokio/Path;Ljava/lang/String;Lokio/Path;ILjava/lang/Object;)Lcom/squareup/wire/SchemaBuilder;
public final fun addProtoPath (Lokio/Path;Ljava/lang/String;)Lcom/squareup/wire/SchemaBuilder;
public final fun build ()Lcom/squareup/wire/schema/Schema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ class SchemaBuilder {
* @param name The qualified name of the file.
* @param protoFile The content of the file.
*/
@JvmOverloads
fun add(name: Path, protoFile: String, path: Path = sourcePath): SchemaBuilder {
fun add(name: Path, protoFile: String): SchemaBuilder {
return add(name, protoFile, sourcePath)
}

/**
* Add a file to be loaded into the schema.
*
* @param name The qualified name of the file.
* @param protoFile The content of the file.
* @param path The path on which [name] is based.
*/
fun add(name: Path, protoFile: String, path: Path): SchemaBuilder {
require(name.toString().endsWith(".proto")) {
"unexpected file extension for $name. Proto files should use the '.proto' extension"
}
Expand Down

0 comments on commit e73690e

Please sign in to comment.