Because every good developer needs their daily Cup of Java ☕
Cup is a blazingly fast ⚡ (okay, maybe just reasonably fast) build system for Java and Kotlin projects. Named after the most important ingredient in any developer's life - coffee ☕ - Cup aims to make your Java/Kotlin development experience as smooth as a perfectly brewed espresso.
Why "Cup"? Because:
- Java ☕ → Coffee ☕ → Cup ☕
- It's short and sweet (like a good espresso shot)
- You can
cup buildandcup runjust like you can "cup your hands" 🙌 - It holds all your code together (like a cup holds coffee)
- 🔥 Mixed Java/Kotlin Support: Write Java, Kotlin, or mix them like a caffeinated cocktail
- 🎯 Simple Commands:
cup new,cup build,cup run,cup doc- that's it! - 📁 Smart Project Structure: Follows Maven-style conventions (because we're not savages)
- 🔧 Zero Config: Works out of the box, configurable when you need it
- 📚 Auto Documentation: Generate docs faster than you can say "JavaDoc"
- 🏃♂️ Lightning Fast: Compiles your code while you're still reaching for your coffee mug
- 🎨 Pretty Output: Because ugly terminal output is for people who drink instant coffee
# Clone this beauty
git clone https://github.com/Valeriooooh/cup
cd cup
# Build it (you'll need Rust - the language that's faster than your morning coffee routine)
cargo build --release
# Add it to your PATH and start brewing! ☕cup new my-awesome-app
cd my-awesome-app
cup run
# Output: Hello, World! 🌍cup new my-kotlin-masterpiece --kotlin
cd my-kotlin-masterpiece
cup run
# Output: Hello, World! 🌍 (but with more syntactic sugar)cup new my-polyglot-adventure --kotlin
cd my-polyglot-adventure
# Add some Java files in src/main/java/
# Add some Kotlin files in src/main/kotlin/
cup build # Watch the magic happen ✨
cup run # Profit! 💰| Command | What it does | Coffee analogy |
|---|---|---|
cup new <name> |
Creates a new project | Ordering a fresh cup ☕ |
cup new <name> --kotlin |
Creates a Kotlin project | Ordering a fancy latte with extra foam ☕✨ |
cup build |
Compiles your masterpiece | Grinding those beans 🫘 |
cup run |
Runs your application | Taking that first perfect sip ☕😌 |
cup doc |
Generates documentation | Reading the coffee menu 📖☕ |
your-awesome-project/
├── Cup.toml # The recipe for your coffee ☕
├── src/
│ ├── main/
│ │ ├── java/ # Your Java beans 🫘
│ │ └── kotlin/ # Your Kotlin beans (premium blend) 🫘✨
│ └── test/
│ ├── java/ # Java tests (quality control) ✅
│ └── kotlin/ # Kotlin tests (fancy quality control) ✅✨
├── lib/ # External JARs (imported coffee) 🫙
├── build/ # Compiled goodness 🏗️
└── doc/ # Documentation (the manual) 📚
[project]
name = "my-caffeinated-project"
version = "1.0.0"
main_class = "main.MainKt" # For Kotlin: MainKt, for Java: Main
[build]
source_dir = "src/main" # Where the magic happens ✨
output_dir = "build/classes" # Where the compiled magic goes 🎯
test_dir = "src/test" # Where we make sure it works ✅
java_version = "11" # Because we're not living in 2006 📅
doc_dir = "doc" # Where we document our genius 🧠
[dependencies]
# Add your JAR dependencies here
# somelib = "path/to/somelib.jar"Cup handles mixed Java/Kotlin projects like a matchmaker:
Java class (the classic one):
// src/main/java/util/Helper.java
package util;
public class Helper {
public String greet(String name) {
return "Hello, " + name + "! ☕";
}
}Kotlin file (the cool kid):
// src/main/kotlin/Main.kt
package main
import util.Helper
fun main() {
val helper = Helper()
println(helper.greet("Coffee Lover")) // Hello, Coffee Lover! ☕
// Look ma, Java interop! 🎉
}Cup's magic compilation process:
- 🔮 Compiles Kotlin files (including Java source references)
- ⚡ Compiles Java files (with Kotlin classes in classpath)
- 🎉 Everything works together harmoniously
# In your Cup.toml
java_version = "17" # Living in the future! 🚀# Drop your JARs in the lib/ directory
cp awesome-library.jar lib/
cup build # Cup automatically includes them ✨cup doc
# Opens doc/index.html in your heart (and browser) 💖# Install Kotlin (the right way)
# Ubuntu/Debian: sudo snap install kotlin --classic
# macOS: brew install kotlin
# Windows: *confused screaming* (just download from kotlinlang.org)# Check your versions
kotlinc -version
javac -version
# Make sure both exist and are recent-ish# Check your main class name:
# Java: "com.example.Main"
# Kotlin: "com.example.MainKt" (note the Kt suffix)# Clear your build directory and try again
rm -rf build/
cup build
# If that doesn't work, make more coffee and try again ☕We welcome contributions! Whether you:
- 🐛 Found a bug (and didn't just blame it on insufficient coffee)
- 💡 Have a feature idea (preferably coffee-related)
- 📝 Want to improve documentation (make it funnier!)
- ☕ Just want to discuss coffee preferences
Open an issue or PR! But first, make sure you've had your coffee ☕
git clone https://github.com/yourusername/cup
cd cup
cargo build
# Grab a coffee ☕Q: Why not just use Maven/Gradle?
A: Have you tried configuring Maven? It's like trying to make coffee with a manual that's written in ancient Latin. Cup just works. ☕
Q: Is this production ready?
A: Define "production"... If by production you mean "produces coffee-fueled applications," then absolutely! ☕✅
Q: What if I prefer tea?
A: We don't judge, but we also don't understand. This tool is definitely coffee-optimized. 🫖❓
Q: Can I use this for my startup that's going to revolutionize [insert buzzword]?
A: Sure! But remember to give us credit when you're sipping champagne in your penthouse. 🥂🏢
Q: What's the difference between Cup and other build tools?
A: Cup has more emojis and coffee references per line of documentation. Also, it actually works without requiring a PhD in XML. 📜☕
MIT License - because we believe in sharing coffee (and code) freely! ☕📄
Made with ❤️, lots of ☕, and a healthy dose of 🤪 by developers who believe that build tools shouldn't require a computer science degree to understand.
Remember: Life's too short for bad coffee and complicated build systems. Use Cup! ☕✨
P.S. - No actual coffee was harmed in the making of this build system. But a lot was consumed. ☕💀