blob: d0ca11bd0802186c764f5ed1fdec3c9b7e034017 [file] [log] [blame] [raw]
VERSION := 2.7
JDK7_HOME := /opt/jdk1.7.0_80
JDK7_JAVAC = $(JDK7_HOME)/bin/javac
JDK7_JAVAC_FLAGS = -source 1.6 -target 1.6
#JAR ?= $(JDK7_HOME)/bin/jar
7Z ?= 7za
BUKKIT_CLASS_PATH = /opt/minecraft/cauldron-1.7.10-1.1206.01.175-server.jar
CLASS_PATH = /opt/minecraft/libraries/org/mcstats/bukkit/metrics-R8-20160729.181122-1.jar
BUKKIT_PLUGIN_CLASSES := \
build/com/platymuus/bukkit/permissions/Group.class \
build/com/platymuus/bukkit/permissions/PermissionInfo.class \
build/com/platymuus/bukkit/permissions/PermissionsCommand.class \
build/com/platymuus/bukkit/permissions/PermissionsCommand$$1.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$1.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$2.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$3.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$4.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$5.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$6.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$7.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$8.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$9.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$10.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$11.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$12.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$13.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$14.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$15.class \
build/com/platymuus/bukkit/permissions/PermissionsMetrics$$BooleanPlotter.class \
build/com/platymuus/bukkit/permissions/PermissionsPlugin.class \
build/com/platymuus/bukkit/permissions/PermissionsTabComplete.class \
build/com/platymuus/bukkit/permissions/PlayerListener.class
default: build PermissionsBukkit-$(VERSION).jar
PermissionsBukkit-$(VERSION).jar: build/META-INF/MANIFEST.MF $(BUKKIT_PLUGIN_CLASSES) build/config.yml build/plugin.yml
#cd build && $(JAR) -c $(patsubst build/%,%,$(subst $$,\$$,$^)) > ../$@
rm -f $@
cd build && $(7Z) a -tzip ../$@ $(patsubst build/%,%,$(subst $$,\$$,$^))
clean:
rm -f PermissionsBukkit-$(VERSION).jar build/META-INF/MANIFEST.MF $(subst $$,\$$,$(BUKKIT_PLUGIN_CLASSES)) build/config.yml build/plugin.yml
build:
mkdir $@
build/%.class: src/main/java/%.java
$(JDK7_JAVAC) $(JDK7_JAVAC_FLAGS) -classpath $(BUKKIT_CLASS_PATH):$(CLASS_PATH):build:src/main/java -d build $<
build/%$$*.class: src/main/java/%.java
build/%.yml: src/main/resources/%.yml
sed -r 's/\$$\{version\}/$(VERSION)/g' $< > $@
build/META-INF/MANIFEST.MF:
[ -d build/META-INF ] || mkdir -p build/META-INF
echo "Class-Path: libs/metrics.jar" > $@