Adding Java Checker Framework checker option in the makefiles; basically this is...
authorrtrimana <rtrimana@uci.edu>
Wed, 8 Feb 2017 00:59:32 +0000 (16:59 -0800)
committerrtrimana <rtrimana@uci.edu>
Wed, 8 Feb 2017 00:59:32 +0000 (16:59 -0800)
benchmarks/Java/HomeSecurityController/Makefile
benchmarks/Java/IrrigationController/Makefile
benchmarks/Java/Lifxtest/Makefile
benchmarks/Java/SmartLightsController/Makefile
benchmarks/Java/SpeakerController/Makefile
benchmarks/drivers/Java/Makefile

index d507f6c..0a28e91 100644 (file)
@@ -5,15 +5,29 @@ include $(BASE)/common.mk
 BOOFDIR := ../../libs/boofcv_libs
 BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar:$(CHECKERJARS)
 
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.
+JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):$(CHECKERJARS):.
 JARFLAGS = cf 
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: homesecurity
 
+check-all: check-homesecurity
+
 PHONY += homesecurity
 homesecurity:
        $(JAVAC) $(JFLAGS) *.java
        cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
        cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/MotionDetection*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class  ../iotcode/interfaces/ZoneState*.class
 
+PHONY += check-homesecurity
+check-homesecurity:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
+       cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/MotionDetection*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class  ../iotcode/interfaces/ZoneState*.class
+
 .PHONY: $(PHONY)
index 069fd90..e8d863b 100644 (file)
@@ -5,11 +5,19 @@ include $(BASE)/common.mk
 BOOFDIR := ../../libs/boofcv_libs
 BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar:$(CHECKERJARS)
 
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.
+JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):$(CHECKERJARS):.
 JARFLAGS = cf 
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: irrigation
 
+check-all: check-irrigation
+
 PHONY += irrigation
 irrigation:
        $(JAVAC) $(JFLAGS) *.java
@@ -18,4 +26,12 @@ irrigation:
        cp -rf ./resources ./help_files $(BIN_DIR)/IrrigationController
        cd  $(BIN_DIR)/IrrigationController; zip -r IrrigationController.zip ./resources ./help_files
 
+PHONY += check-irrigation
+check-irrigation:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cd  $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class
+       cp IrrigationController.config $(BIN_DIR)/IrrigationController
+       cp -rf ./resources ./help_files $(BIN_DIR)/IrrigationController
+       cd  $(BIN_DIR)/IrrigationController; zip -r IrrigationController.zip ./resources ./help_files
+
 .PHONY: $(PHONY)
index 08c190b..1fbe204 100755 (executable)
@@ -2,16 +2,30 @@ BASE = ../../..
 
 include $(BASE)/common.mk
 
-JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):.
+JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):$(CHECKERJARS):.
 JARFLAGS = cf 
 JARFLAGS_SMARTLIGHTS = cf Lifxtest.jar
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: lifxtest
 
+check-all: check-lifxtest
+
 PHONY += lifxtest
 lifxtest:
        $(JAVAC) $(JFLAGS) *.java
        cp Lifxtest.config $(BIN_DIR)/Lifxtest
        cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class
 
+PHONY += check-lifxtest
+check-lifxtest:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cp Lifxtest.config $(BIN_DIR)/Lifxtest
+       cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class
+
 .PHONY: $(PHONY)
index 256b5b7..69d132b 100644 (file)
@@ -5,15 +5,29 @@ include $(BASE)/common.mk
 BOOFDIR := ../../libs/boofcv_libs
 BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar:$(CHECKERJARS)
 
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.
+JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):$(CHECKERJARS):.
 JARFLAGS = cf 
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: smartlights
 
+check-all: check-smartlights
+
 PHONY += smartlights
 smartlights:
        $(JAVAC) $(JFLAGS) *.java
        cp SmartLightsController.config $(BIN_DIR)/SmartLightsController
        cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class
 
+PHONY += check-smartlights
+check-smartlights:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cp SmartLightsController.config $(BIN_DIR)/SmartLightsController
+       cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class
+
 .PHONY: $(PHONY)
index 61459c0..90dc1a7 100644 (file)
@@ -7,11 +7,19 @@ BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(B
 JLAYERDIR := ../../libs/jlayer_libs
 JLAYERJARS := $(JLAYERDIR)/jl1.0.1.jar
 
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.:$(JLAYERJARS)
+JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.:$(JLAYERJARS):$(CHECKERJARS)
 JARFLAGS = cf 
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: speaker
 
+check-all: check-speaker
+
 PHONY += speaker
 speaker:
        $(JAVAC) $(JFLAGS) *.java
@@ -20,4 +28,12 @@ speaker:
        zip -r SpeakerController.zip ./music
        mv SpeakerController.zip $(BIN_DIR)/SpeakerController
 
+PHONY += check-speaker
+check-speaker:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
+       cd  $(BIN_DIR)/SpeakerController; $(JAR) $(JARFLAGS) SpeakerController.jar ../SpeakerController/*.class ../iotcode/interfaces/*.class
+       cp SpeakerController.config $(BIN_DIR)/SpeakerController
+       zip -r SpeakerController.zip ./music
+       mv SpeakerController.zip $(BIN_DIR)/SpeakerController
+
 .PHONY: $(PHONY)
index cd5d083..3818f8a 100644 (file)
@@ -6,13 +6,20 @@ BOOFDIR := ../libs/boofcv_libs
 BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar
 JLAYERDIR := ../libs/jlayer_libs
 JLAYERJARS := $(JLAYERDIR)/jl1.0.1.jar
-JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):$(PHONEJARS):$(BOOFJARS):$(JLAYERJARS)
+JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):$(PHONEJARS):$(BOOFJARS):$(JLAYERJARS):$(CHECKERJARS)
 JARFLAGS = cf
 INTFACE_DIR = iotcode/interfaces
 
+# checker option
+#
+CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
+
+ASTUBS = -Astubs=../../../checker/astubs/ 
+
 all: light camera labroom greenlawn sprinkler moisture weathergateway audioroom gpsgateway ihome homeroom alarm motion multipurpose waterleak
+check-all: check-light check-camera check-labroom check-greenlawn check-sprinkler check-moisture check-weathergateway check-audioroom check-gpsgateway check-ihome check-homeroom check-alarm check-motion check-multipurpose check-waterleak
 
-# Compile
+# Compile - without checker
 #
 PHONY += light
 light:
@@ -104,4 +111,97 @@ waterleak:
        cp WaterLeakSensor/WaterLeakSensor.config $(BIN_DIR)/iotcode/WaterLeakSensor
        cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
 
+
+# Compile - with checker
+#
+PHONY += check-light
+check-light:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) LifxLightBulb/*.java
+       cp LifxLightBulb/LifxLightBulb.config $(BIN_DIR)/iotcode/LifxLightBulb
+       cd $(BIN_DIR)/iotcode/LifxLightBulb; $(JAR) $(JARFLAGS) LifxLightBulb.jar ../../iotcode/LifxLightBulb/*.class ../../iotcode/interfaces/LightBulb*.class
+
+PHONY += check-camera
+check-camera:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) AmcrestCamera/*.java
+       cp AmcrestCamera/AmcrestCamera.config $(BIN_DIR)/iotcode/AmcrestCamera
+       cd $(BIN_DIR)/iotcode/AmcrestCamera; $(JAR) $(JARFLAGS) AmcrestCamera.jar ../../iotcode/AmcrestCamera/*.class ../../iotcode/interfaces/Camera*.class ../../iotcode/interfaces/Resolution*.class
+
+PHONY += check-labroom
+check-labroom:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) LabRoom/*.java
+       cp LabRoom/LabRoom.config $(BIN_DIR)/iotcode/LabRoom
+       cd $(BIN_DIR)/iotcode/LabRoom; $(JAR) $(JARFLAGS) LabRoom.jar ../../iotcode/LabRoom/*.class ../../iotcode/interfaces/Room*.class
+
+PHONY += check-greenlawn
+check-greenlawn:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) GreenLawn/*.java
+       cp GreenLawn/GreenLawn.config $(BIN_DIR)/iotcode/GreenLawn
+       cd $(BIN_DIR)/iotcode/GreenLawn; $(JAR) $(JARFLAGS) GreenLawn.jar ../../iotcode/GreenLawn/*.class ../../iotcode/interfaces/Lawn*.class
+
+PHONY += check-sprinkler
+check-sprinkler:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) EspSprinkler/*.java
+       cp EspSprinkler/EspSprinkler.config $(BIN_DIR)/iotcode/EspSprinkler
+       cd $(BIN_DIR)/iotcode/EspSprinkler; $(JAR) $(JARFLAGS) EspSprinkler.jar ../../iotcode/EspSprinkler/*.class ../../iotcode/interfaces/Sprinkler*.class ../../iotcode/interfaces/ZoneState*.class
+
+PHONY += check-moisture
+check-moisture:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) SpruceSensor/*.java
+       cp SpruceSensor/SpruceSensor.config $(BIN_DIR)/iotcode/SpruceSensor
+       cd $(BIN_DIR)/iotcode/SpruceSensor; $(JAR) $(JARFLAGS) SpruceSensor.jar ../../iotcode/SpruceSensor/*.class ../../iotcode/interfaces/MoistureSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
+
+PHONY += check-weathergateway
+check-weathergateway:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) WeatherPhoneGateway/*.java
+       cp WeatherPhoneGateway/WeatherPhoneGateway.config $(BIN_DIR)/iotcode/WeatherPhoneGateway
+       cd $(BIN_DIR)/iotcode/WeatherPhoneGateway; $(JAR) $(JARFLAGS) WeatherPhoneGateway.jar ../../iotcode/WeatherPhoneGateway/*.class ../../iotcode/interfaces/WeatherGateway*.class
+
+PHONY += check-audioroom
+check-audioroom:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) AudioRoom/*.java
+       cp AudioRoom/AudioRoom.config $(BIN_DIR)/iotcode/AudioRoom
+       cd $(BIN_DIR)/iotcode/AudioRoom; $(JAR) $(JARFLAGS) AudioRoom.jar ../../iotcode/AudioRoom/*.class ../../iotcode/interfaces/Room*.class
+
+PHONY += check-gpsgateway
+check-gpsgateway:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) GPSPhoneGateway/*.java
+       cp GPSPhoneGateway/GPSPhoneGateway.config $(BIN_DIR)/iotcode/GPSPhoneGateway
+       cd $(BIN_DIR)/iotcode/GPSPhoneGateway; $(JAR) $(JARFLAGS) GPSPhoneGateway.jar ../../iotcode/GPSPhoneGateway/*.class ../../iotcode/interfaces/GPSGateway*.class
+
+PHONY += check-ihome
+check-ihome:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) IHome/*.java
+       cp IHome/IHome.config $(BIN_DIR)/iotcode/IHome
+       cd $(BIN_DIR)/iotcode/IHome; $(JAR) $(JARFLAGS) IHome.jar ../../iotcode/IHome/*.class ../../iotcode/interfaces/Speaker*.class
+
+PHONY += check-homeroom
+check-homeroom:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) HomeRoom/*.java
+       cp HomeRoom/HomeRoom.config $(BIN_DIR)/iotcode/HomeRoom
+       cd $(BIN_DIR)/iotcode/HomeRoom; $(JAR) $(JARFLAGS) HomeRoom.jar ../../iotcode/HomeRoom/*.class ../../iotcode/interfaces/Room*.class
+
+PHONY += check-alarm
+check-alarm:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) EspAlarm/*.java
+       cp EspAlarm/EspAlarm.config $(BIN_DIR)/iotcode/EspAlarm
+       cd $(BIN_DIR)/iotcode/EspAlarm; $(JAR) $(JARFLAGS) EspAlarm.jar ../../iotcode/EspAlarm/*.class ../../iotcode/interfaces/Alarm*.class ../../iotcode/interfaces/ZoneState*.class
+
+PHONY += check-motion
+check-motion:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) MotionSensor/*.java
+       cp MotionSensor/MotionSensor.config $(BIN_DIR)/iotcode/MotionSensor
+       cd $(BIN_DIR)/iotcode/MotionSensor; $(JAR) $(JARFLAGS) MotionSensor.jar ../../iotcode/MotionSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
+
+PHONY += check-multipurpose
+check-multipurpose:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) MultipurposeSensor/*.java
+       cp MultipurposeSensor/MultipurposeSensor.config $(BIN_DIR)/iotcode/MultipurposeSensor
+       cd $(BIN_DIR)/iotcode/MultipurposeSensor; $(JAR) $(JARFLAGS) MultipurposeSensor.jar ../../iotcode/MultipurposeSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
+
+PHONY += check-waterleak
+check-waterleak:
+       $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) WaterLeakSensor/*.java
+       cp WaterLeakSensor/WaterLeakSensor.config $(BIN_DIR)/iotcode/WaterLeakSensor
+       cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
+
 .PHONY: $(PHONY)