A DSL based validator for the Declarative Watch Face format - used by WearOS devices for third-party watch faces.
dwf-validator/
├── dwf-validator/ # Core validator library module
│ ├── src/
│ │ ├── commonMain/kotlin/ # Kotlin multiplatform common code
│ │ │ ├── constraint/ # Constraint generation logic
│ │ │ ├── error/ # Error/Validation Result handling
│ │ │ ├── expression/ # Expression parser logic
│ │ │ └── specification/ # WFF specifications written in DSL
│ │ ├── jvmMain/kotlin/ # JVM-specific XML parsing
│ │ ├── jsMain/kotlin/ # JavaScript-specific XML parsing
│ │ ├── commonTest/ # Common tests
│ │ ├── jvmTest/ # JVM-specific tests
│ │ └── jsTest/ # JavaScript-specific tests
│ └── build.gradle.kts # Validator module build config
│
└── dwf-validator-cli/ # Command-Line Interface
The command line interface can be used as a jar file or through the gradle run command.
# use the cli as a standalone jar
java -jar dwf-validator-cli.jar --source <path-to-apk>
# run with gradle
gradle dwf-validator-cli:run --args="--source <path-to-apk>"
# or, from the project root directory:
./gradlew dwf-validator-cli:run --args="--source <path-to-apk>"
Output:
Validation Failed for file: /Users/bcummings/Dev/watchface-dwf-validator/dwf-validator-cli/src/main/resources/example-watchface.xml.
Global Errors:
WatchFace > Scene > PartDraw:
- Illegal Attribute Value:
Attribute: "y" has illegal value: "three".
Value must be an integer.
Options:
--source <path> Path to DWF file to validate
-x, --raw-xml Reads raw xml file instead of apk
java -jar dwf-validator-cli.jar --source <path-to-apk>Note: The validator expects the raw XML to be located in dwf-apk/res/raw.
java -jar dwf-validator-cli.jar --raw-xml --source <path-to-apk>This project is licensed under the Apache License, Version 2.0 (See the LICENSE). This license is inherited from the parent repository: google/watchface.
Note: This project was developed by and is property of Google.