これは、Windows コマンド ラインでスクリプトを作成する最初の試みです。変数を使用して、記述しようとしているコマンドを読みやすくしようとしています。残念ながら、スクリプトを正しく動作させることができず、Pause_ が cmd ウィンドウを開いたままにしておらず、何が問題なのかを確認できます。以下は、これまでに作成したスクリプトです。
@echo off
:: Script for generating java classes from xsd using jibx
::
:: Create variables for the different paths for easy editing later
set jibx = ../../Libraries/jibx/lib/jibx-tools.jar
set CodeGen = org.jibx.schema.codegen.CodeGen
set package = src/com/TersoSolutions/Jetstream/SDK/
set source = resources/xsd/
set binding = resources/bindings/
::
::
:: First Command
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd
::
:: Repeat the command
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse2.xml -p %package%Application/Model/GetConfigurationResponse2 %source%Application/1.1/GetConfigurationResponse.xsd
::
Pause_
目的は、同様の方法でコマンドを繰り返し、実行する必要があるすべての操作をリストできる方法でスクリプトを記述できることを確認することでした。
編集:
スクリプトで複製しようとしているコマンドは、次のようにコマンドラインで直接機能します
java -cp ../../Libraries/jibx/lib/jibx-tools.jar org.jibx.schema.codegen.CodeGen -b /resources/bindings/GetConfigurationResponse.xml -p com.TersoSolutions.JetStream.SDK.Application.Model.GetConfigurationResponse /resources/xsd/Applicationi/1.1/GetConfigurationResponse.xsd