Improve gradle tasks
This commit is contained in:
@@ -87,4 +87,4 @@ class Function(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,4 @@ class Migration(
|
||||
|
||||
class MigrationNotFound(cause: Throwable? = null) : Resource.ParseException("Migration not found in script", cause)
|
||||
enum class Direction { UP, DOWN }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,4 @@ class Parameter(val name: String, val type: String, direction: Direction? = Dire
|
||||
|
||||
interface ParametersInterface {
|
||||
val parameters: List<Parameter>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ class Query(
|
||||
"""-- *name ?: ?(?<name>[^ \n]+)"""
|
||||
.toRegex(setOf(RegexOption.IGNORE_CASE, RegexOption.MULTILINE))
|
||||
.find(script)?.let {
|
||||
it.groups["name"]?.value?.trim()
|
||||
}
|
||||
it.groups["name"]?.value?.trim()
|
||||
}
|
||||
|
||||
/** Try to get name from the filename */
|
||||
private fun getNameFromFile(source: Path): String = source
|
||||
.fileName.toString()
|
||||
.substringAfterLast("/")
|
||||
.substringBeforeLast(".sql")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,4 @@ interface Resource {
|
||||
|
||||
interface ResourceCollection {
|
||||
val parameters: List<Parameter>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user