### Example Card List for Quick Start Source: https://github.com/magefree/mage/wiki/Development-Testing-Tools This list displays the format of card decks used when starting a game in test mode with the 'Quick Start' button. It specifies the quantity and card identifier for each card. ```plaintext 5 [XLN:268] Swamp 5 [XLN:276] Forest 5 [XLN:264] Island 5 [XLN:272] Mountain 5 [XLN:260] Plains ``` -------------------------------- ### Run Maven Clean and Install Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Example Maven command to first clean the project (removing previous build artifacts) and then build the project with tests. This is a common command for ensuring a clean build. ```bash mvn clean install -DskipTests ``` -------------------------------- ### Init.txt Configuration File Example Source: https://github.com/magefree/mage/wiki/Development-Testing-Tools This is an example of the 'init.txt' file used for server test mode. It demonstrates various commands for adding cards to different game zones, creating tokens, and setting planeswalker loyalty, organized into groups. ```plaintext // Allows run cheat commands in any games. How to use: // * open launcher and add to server's command line: -Dxmage.testMode=true // * rename that file to init.txt and put to server's config folder // * activate smiley button on your player's panel [init] battlefield:Human:Forest:5 battlefield:Human:Plains:5 battlefield:Human:Mountain:5 battlefield:Human:Swamp:5 battlefield:Human:Island:5 hand:Human:Lightning Bolt:2 [quick game example] graveyard:Human:Bloodghast:1 graveyard:Computer:Bloodghast:1 hand:Human:Bloodghast:1 hand:Computer:Bloodghast:1 [real game example] graveyard:ReachyRichGuy:Bloodghast:1 graveyard:Computer 3:Bloodghast:1 [add tokens] token:Human:TreasureToken:10 token:Human:ZombieArmyToken:3 [add planeswalker with loyalty] battlefield:Human:Karn Liberated:1 loyalty:Human:Karn Liberated:20 [add emblem] emblem:Human:ElspethSunsChampionEmblem:1 [add commander] commander:Human:Silvercoat Lion:1 // @ref command example (all refs will be replaced by commands from ref's group) [ref usage] @init hand:Human:Lightning Bolt:2 // real test example [test karn restart] @init @bears battlefield:Human:Karn Liberated:1 loyalty:Human:Karn Liberated:20 commander:Human:Silvercoat Lion:1 exiled:Human:Lightning Bolt:1 exiled:Human:Silvercoat Lion:1 exiled:Computer:Silvercoat Lion:1 // create any useful commands for fast usage [clone] hand:Human:Clone:3 [force attack] hand:Human:Pit Fight:3 [exile] hand:Human:Angelic Edict:3 [bears] battlefield:Computer:Grizzly Bears:2 battlefield:Human:Grizzly Bears:2 [diff set codes example] battlefield:Human:XLN-Island:1 battlefield:Human:UST-Island:1 battlefield:Human:HOU-Island:1 ``` -------------------------------- ### Build Mage Project with Maven Source: https://github.com/magefree/mage/wiki/Development-Workflow These Maven commands are used to build the Mage project. 'clean install -DskipTests' compiles and packages the project while skipping tests, ensuring a quicker build. 'assembly:assembly' is then used to build the release packages for the client and server components. ```maven mvn clean install -DskipTests mvn assembly:assembly ``` -------------------------------- ### Start Mage Server with Custom Configuration - Command Line Source: https://context7.com/magefree/mage/llms.txt This command line example demonstrates how to launch the Mage server using a custom configuration file. The `-Dxmage.config.path` system property is used to specify the location of the alternative XML configuration file. ```bash java -jar mage-server.jar -Dxmage.config.path=config/my-config.xml ``` -------------------------------- ### Configure Client Build Task (Maven) Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Adds a 'Run Maven Goal' task to the client's 'Before launch' configuration to build and install the client before running. This optimizes build times. ```text Before launch task: Run Maven Goal Working directory: ..mage_path\Mage.Client Command line: install -DskipTests ``` -------------------------------- ### Configure 'clean-dbs' External Tool (Windows) Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Setup for the 'clean-dbs' external tool on Windows using Git Bash, specifying the program, arguments, and working directory. ```text Name: clean-dbs Program: C:\Program Files\Git\bin\bash.exe Arguments: "clean_dbs.sh" Working directory: $ProjectFileDir$ ``` -------------------------------- ### Configure 'clean-dbs' External Tool (macOS/Linux) Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Setup for the 'clean-dbs' external tool on macOS or Linux using bash, specifying the program, arguments, and working directory. ```text Name: clean-dbs Program: bash Arguments: "clean_dbs.sh" Working directory: $ProjectFileDir$ ``` -------------------------------- ### Create 'Clean dbs and run server in test mode' Configuration Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment IntelliJ run configuration to automatically clean the XMage database and start the server in test mode. ```text Configuration type: Application Name: Clean dbs, run server in test mode Main class: mage.server.Main Use classpath of module: mage-server Program arguments: -testMode=true Before launch: External tool 'clean-dbs' ``` -------------------------------- ### Locate sha1sum after Coreutils Installation on macOS Source: https://github.com/magefree/mage/wiki/Mage-Updater This path indicates the location of the 'sha1sum' command after installing GNU coreutils via Homebrew on macOS. This is necessary to use the correct version of the utility for generating checksums. ```shell /usr/local/opt/coreutils/libexec/gnubin/sha1sum ``` -------------------------------- ### Install Coreutils on macOS Source: https://github.com/magefree/mage/wiki/Mage-Updater This command installs the GNU coreutils package on macOS using Homebrew. This provides access to utilities like 'sha1sum', which might be needed for generating checksums if the system's default version is insufficient. ```shell brew install coreutils ``` -------------------------------- ### Maven Build Commands for XMage Project Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Commands to perform full, fast, and release builds of the XMage project using Apache Maven. The full build is recommended for initial setup, while the fast build is suitable for incremental development. The release build generates distributable files. ```bash mvn clean install -DskipTests ``` ```bash mvn install -DskipTests ``` -------------------------------- ### Example: List Cards Added Since Specific Commit (Unix/macOS) Source: https://github.com/magefree/mage/blob/master/Utils/release/getting_implemented_cards.txt This example demonstrates how to list cards added since a specific commit hash (e.g., 8dca887fadbbea41fb649ff17c5fe547a82ef23a) up to HEAD, formatted for Unix-like systems. ```bash git log 8dca887fadbbea41fb649ff17c5fe547a82ef23a..HEAD --diff-filter=A --name-status | sed -ne 's/^A[^u]Mage.Sets\/src\/mage\/sets\///p' | sort -u > added_cards.txt ``` -------------------------------- ### Build XMage Project with Maven Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Command to build the entire XMage project using Maven. It skips running tests to speed up the build process. Ensure Maven is installed and accessible in your system's PATH. ```bash mvn install -DskipTests ``` -------------------------------- ### Example: List Cards Added Since Specific Version (Windows) Source: https://github.com/magefree/mage/blob/master/Utils/release/getting_implemented_cards.txt This example shows how to list cards added since a specific version (e.g., 1.4.3.v0) up to HEAD, adapted for Windows command line usage. ```bash git log 5de4637d9c7967612c207d3cf915c2861d922029..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt ``` -------------------------------- ### Configure Client Run/Debug Configuration Source: https://github.com/magefree/mage/wiki/Setting-up-your-Development-Environment Sets up the IntelliJ run configuration to launch the Mage client. It specifies the main class, working directory, and classpath module. 'Build' task is removed if present. ```text Application name: Run Client Main class: mage.client.MageFrame Working directory: root of the Mage.Client directory Use classpath of module: Mage.Client Remove 'Build' task from 'Before launch' ```