Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions zstack-dev-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependency-reduced-pom.xml
17 changes: 17 additions & 0 deletions zstack-dev-tool/dev-tool
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# ZStack Dev Tool - static code generation checker
# Usage: ./dev-tool check|generate|scan [globalconfig|all]

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
JAR="$SCRIPT_DIR/target/dev-tool.jar"

if [ ! -f "$JAR" ]; then
echo "Building dev-tool..."
cd "$SCRIPT_DIR" && mvn package -DskipTests -q
if [ $? -ne 0 ]; then
echo "ERROR: Build failed"
exit 1
fi
fi

cd "$SCRIPT_DIR/.." && java -jar "$JAR" "$@"
69 changes: 69 additions & 0 deletions zstack-dev-tool/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.zstack</groupId>
<artifactId>zstack-dev-tool</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>zstack-dev-tool</name>
<description>Static code generation tool for ZStack CI checks</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<javaparser.version>3.25.8</javaparser.version>
</properties>

<dependencies>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>${javaparser.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>shade</goal></goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.zstack.devtool.DevTool</mainClass>
</transformer>
</transformers>
<finalName>dev-tool</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading