|
2 | 2 |
|
3 | 3 | ## Prerequisites |
4 | 4 |
|
5 | | -- **Java 17** (required for building only) |
6 | | -- **SBT** (Scala Build Tool) |
| 5 | +- **Java 17** (required for building) |
| 6 | +- **SBT 1.10.6+** (Scala Build Tool) |
7 | 7 |
|
8 | | -## Build Steps |
| 8 | +## Build Commands |
9 | 9 |
|
10 | | -### 1. Set Java 17 |
| 10 | +### For Development (Fat JAR) |
11 | 11 |
|
12 | 12 | ```bash |
| 13 | +# Set Java 17 |
13 | 14 | export JAVA_HOME=$(/usr/libexec/java_home -v 17) |
| 15 | + |
| 16 | +# Build single JAR with all dependencies |
| 17 | +sbt clean assembly |
14 | 18 | ``` |
15 | 19 |
|
16 | | -### 2. Build the Extension |
| 20 | +**Output:** `target/scala-3.7.0/llm.jar` (172MB) |
| 21 | + |
| 22 | +### For Distribution (ZIP Package) |
17 | 23 |
|
18 | 24 | ```bash |
19 | | -sbt clean assembly |
| 25 | +# Set Java 17 |
| 26 | +export JAVA_HOME=$(/usr/libexec/java_home -v 17) |
| 27 | + |
| 28 | +# Build distribution package |
| 29 | +sbt clean packageZip |
20 | 30 | ``` |
21 | 31 |
|
22 | | -This creates `target/scala-3.7.0/llm.jar` (approximately 180MB fat JAR with all dependencies). |
| 32 | +**Output:** `llm-0.1.0.zip` (11MB) |
| 33 | + |
| 34 | +## Build Outputs Explained |
23 | 35 |
|
24 | | -## That's It! |
| 36 | +### Fat JAR (assembly) |
| 37 | +- **Location**: `target/scala-3.7.0/llm.jar` |
| 38 | +- **Size**: ~172MB |
| 39 | +- **Type**: Single JAR with all dependencies bundled inside |
| 40 | +- **Use**: Local development, simple installation |
| 41 | +- **Install**: Copy one file to NetLogo extensions |
25 | 42 |
|
26 | | -The JAR file is now ready to install. See `INSTALL.md` for installation instructions. |
| 43 | +### ZIP Package (packageZip) |
| 44 | +- **Location**: `llm-0.1.0.zip` (project root) |
| 45 | +- **Size**: ~11MB |
| 46 | +- **Type**: Multiple JARs + documentation |
| 47 | +- **Use**: Official releases, NetLogo Extension Library |
| 48 | +- **Install**: Extract entire folder to NetLogo extensions |
27 | 49 |
|
28 | | -## Build Output |
| 50 | +## Which Build Should I Use? |
29 | 51 |
|
30 | | -- **Location**: `target/scala-3.7.0/llm.jar` |
31 | | -- **Type**: Fat JAR (all dependencies bundled inside) |
32 | | -- **Size**: ~180MB |
| 52 | +| Purpose | Command | Output | |
| 53 | +|---------|---------|--------| |
| 54 | +| **Testing locally** | `sbt assembly` | Fat JAR (172MB) | |
| 55 | +| **Quick install** | `sbt assembly` | Fat JAR (172MB) | |
| 56 | +| **Official release** | `sbt packageZip` | ZIP (11MB) | |
| 57 | +| **Publish to library** | `sbt packageZip` | ZIP (11MB) | |
33 | 58 |
|
34 | 59 | ## Common Issues |
35 | 60 |
|
| 61 | +**Problem**: Build fails with SBT parser errors |
| 62 | +**Solution**: Upgrade SBT to 1.10.6+ in `project/build.properties`: |
| 63 | +``` |
| 64 | +sbt.version=1.10.6 |
| 65 | +``` |
| 66 | + |
36 | 67 | **Problem**: Build fails with Java version errors |
37 | 68 | **Solution**: Make sure you're using Java 17: |
38 | 69 | ```bash |
39 | 70 | java -version # Should show 17.x.x |
40 | 71 | ``` |
41 | 72 |
|
42 | 73 | **Problem**: Old JAR still being used |
43 | | -**Solution**: Always run `sbt clean assembly` (not just `assembly`) |
| 74 | +**Solution**: Always use `clean` before building: |
| 75 | +```bash |
| 76 | +sbt clean assembly # Not just 'assembly' |
| 77 | +``` |
0 commit comments