{"action":"created","comment":{"url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/comments/47438982","id":47438982,"diff_hunk":"@@ -0,0 +1,89 @@\n+/*\n+ * Copyright 2015 Alexander Mackworth\n+ *\n+ * This file is part of the CCRE, the Common Chicken Runtime Engine.\n+ *\n+ * The CCRE is free software: you can redistribute it and/or modify it under the\n+ * terms of the GNU Lesser General Public License as published by the Free\n+ * Software Foundation, either version 3 of the License, or (at your option) any\n+ * later version.\n+ *\n+ * The CCRE is distributed in the hope that it will be useful, but WITHOUT ANY\n+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n+ * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more\n+ * details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with the CCRE.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+package ccre.deployment.eggs;\n+\n+import java.io.File;\n+import java.nio.file.Files;\n+import java.nio.file.StandardCopyOption;\n+import java.time.LocalDateTime;\n+import java.time.format.DateTimeFormatter;\n+import java.util.jar.Manifest;\n+\n+import ccre.deployment.Artifact;\n+import ccre.deployment.DepProject;\n+import ccre.deployment.DepJar;\n+import ccre.deployment.DepRoboRIO;\n+import ccre.deployment.Jar;\n+import ccre.deployment.JarBuilder;\n+import ccre.frc.DeviceListMain;\n+import ccre.log.Logger;\n+\n+public class DepEgg {\n+    public static final String userCodeJarName = \"usercode.jar\";\n+    public static final String depEngineJarName = \"DepEngine.jar\";\n+\n+    public static void layEgg(Artifact userCode, ArtifactDeployer hatchAction) throws Exception {\n+        Logger.info(\"Laying egg...\");\n+\n+        File userJar = userCode.toJar(false).toFile();\n+        Manifest manifest = DepJar.manifest(\"Main-Class\", EggHatcher.class.getName(), \"Hatch-Action\", hatchAction.getClass().getName());\n+\n+        JarBuilder builder = new JarBuilder(manifest, false);\n+        builder.addResource(userCodeJarName, userJar);\n+\n+        Jar deploymentEngine = new Jar(new File(DepProject.ccreProject(\"DeploymentEngine\"), depEngineJarName));\n+        builder.addAll(deploymentEngine, false);\n+\n+        Jar egg = builder.build();\n+\n+        File folder = new File(DepProject.root(), \"eggs\");\n+        if (!folder.exists() && !folder.isDirectory() && !folder.mkdir()) {","path":"DeploymentEngine/src/ccre/deployment/eggs/DepEgg.java","position":56,"original_position":56,"commit_id":"f8908d97c4c01f66e47ebfe45780efe9357a3c53","original_commit_id":"f8908d97c4c01f66e47ebfe45780efe9357a3c53","user":{"login":"col6y","id":5056099,"avatar_url":"https://avatars.githubusercontent.com/u/5056099?v=3","gravatar_id":"","url":"https://api.github.com/users/col6y","html_url":"https://github.com/col6y","followers_url":"https://api.github.com/users/col6y/followers","following_url":"https://api.github.com/users/col6y/following{/other_user}","gists_url":"https://api.github.com/users/col6y/gists{/gist_id}","starred_url":"https://api.github.com/users/col6y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/col6y/subscriptions","organizations_url":"https://api.github.com/users/col6y/orgs","repos_url":"https://api.github.com/users/col6y/repos","events_url":"https://api.github.com/users/col6y/events{/privacy}","received_events_url":"https://api.github.com/users/col6y/received_events","type":"User","site_admin":false},"body":"What if the \"folder\" exists but isn't a directory? Think about what this condition is really asking here.","created_at":"2015-12-13T00:58:20Z","updated_at":"2015-12-13T00:58:20Z","html_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130#discussion_r47438982","pull_request_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/comments/47438982"},"html":{"href":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130#discussion_r47438982"},"pull_request":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130","id":53342672,"html_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130","diff_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130.diff","patch_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130.patch","issue_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/130","number":130,"state":"open","locked":false,"title":"CCRE Eggs","user":{"login":"amackworth","id":509593,"avatar_url":"https://avatars.githubusercontent.com/u/509593?v=3","gravatar_id":"","url":"https://api.github.com/users/amackworth","html_url":"https://github.com/amackworth","followers_url":"https://api.github.com/users/amackworth/followers","following_url":"https://api.github.com/users/amackworth/following{/other_user}","gists_url":"https://api.github.com/users/amackworth/gists{/gist_id}","starred_url":"https://api.github.com/users/amackworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amackworth/subscriptions","organizations_url":"https://api.github.com/users/amackworth/orgs","repos_url":"https://api.github.com/users/amackworth/repos","events_url":"https://api.github.com/users/amackworth/events{/privacy}","received_events_url":"https://api.github.com/users/amackworth/received_events","type":"User","site_admin":false},"body":"Initial version of CCRE Eggs! (see #41 for details.) Currently GUI-less, but It Works™.","created_at":"2015-12-11T01:26:48Z","updated_at":"2015-12-13T00:58:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1dc7032805fd0d8e44b0d99245758ca56c11be3f","assignee":{"login":"col6y","id":5056099,"avatar_url":"https://avatars.githubusercontent.com/u/5056099?v=3","gravatar_id":"","url":"https://api.github.com/users/col6y","html_url":"https://github.com/col6y","followers_url":"https://api.github.com/users/col6y/followers","following_url":"https://api.github.com/users/col6y/following{/other_user}","gists_url":"https://api.github.com/users/col6y/gists{/gist_id}","starred_url":"https://api.github.com/users/col6y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/col6y/subscriptions","organizations_url":"https://api.github.com/users/col6y/orgs","repos_url":"https://api.github.com/users/col6y/repos","events_url":"https://api.github.com/users/col6y/events{/privacy}","received_events_url":"https://api.github.com/users/col6y/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130/commits","review_comments_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130/comments","review_comment_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/130/comments","statuses_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/statuses/f8908d97c4c01f66e47ebfe45780efe9357a3c53","head":{"label":"flamingchickens1540:eggs","ref":"eggs","sha":"f8908d97c4c01f66e47ebfe45780efe9357a3c53","user":{"login":"flamingchickens1540","id":5280254,"avatar_url":"https://avatars.githubusercontent.com/u/5280254?v=3","gravatar_id":"","url":"https://api.github.com/users/flamingchickens1540","html_url":"https://github.com/flamingchickens1540","followers_url":"https://api.github.com/users/flamingchickens1540/followers","following_url":"https://api.github.com/users/flamingchickens1540/following{/other_user}","gists_url":"https://api.github.com/users/flamingchickens1540/gists{/gist_id}","starred_url":"https://api.github.com/users/flamingchickens1540/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flamingchickens1540/subscriptions","organizations_url":"https://api.github.com/users/flamingchickens1540/orgs","repos_url":"https://api.github.com/users/flamingchickens1540/repos","events_url":"https://api.github.com/users/flamingchickens1540/events{/privacy}","received_events_url":"https://api.github.com/users/flamingchickens1540/received_events","type":"Organization","site_admin":false},"repo":{"id":25059625,"name":"common-chicken-runtime-engine","full_name":"flamingchickens1540/common-chicken-runtime-engine","owner":{"login":"flamingchickens1540","id":5280254,"avatar_url":"https://avatars.githubusercontent.com/u/5280254?v=3","gravatar_id":"","url":"https://api.github.com/users/flamingchickens1540","html_url":"https://github.com/flamingchickens1540","followers_url":"https://api.github.com/users/flamingchickens1540/followers","following_url":"https://api.github.com/users/flamingchickens1540/following{/other_user}","gists_url":"https://api.github.com/users/flamingchickens1540/gists{/gist_id}","starred_url":"https://api.github.com/users/flamingchickens1540/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flamingchickens1540/subscriptions","organizations_url":"https://api.github.com/users/flamingchickens1540/orgs","repos_url":"https://api.github.com/users/flamingchickens1540/repos","events_url":"https://api.github.com/users/flamingchickens1540/events{/privacy}","received_events_url":"https://api.github.com/users/flamingchickens1540/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine","description":"The CCRE is Team 1540's powerful open-source robot code framework, primarily for FIRST Robotics Competition robots. Click on the Wiki link to the right for more info!","fork":false,"url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine","forks_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/forks","keys_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/teams","hooks_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/hooks","issue_events_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/events{/number}","events_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/events","assignees_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/assignees{/user}","branches_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/branches{/branch}","tags_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/tags","blobs_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/languages","stargazers_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/stargazers","contributors_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/contributors","subscribers_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/subscribers","subscription_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/subscription","commits_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/contents/{+path}","compare_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/merges","archive_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/downloads","issues_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues{/number}","pulls_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/labels{/name}","releases_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/releases{/id}","created_at":"2014-10-11T01:51:36Z","updated_at":"2015-11-22T18:33:39Z","pushed_at":"2015-12-13T00:49:33Z","git_url":"git://github.com/flamingchickens1540/common-chicken-runtime-engine.git","ssh_url":"git@github.com:flamingchickens1540/common-chicken-runtime-engine.git","clone_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine.git","svn_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine","homepage":"","size":27178,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":40,"forks":4,"open_issues":40,"watchers":8,"default_branch":"devel-3.x.x"}},"base":{"label":"flamingchickens1540:devel-3.x.x","ref":"devel-3.x.x","sha":"e20be6c84e07f5ec2244647bb11b07d50e3624ea","user":{"login":"flamingchickens1540","id":5280254,"avatar_url":"https://avatars.githubusercontent.com/u/5280254?v=3","gravatar_id":"","url":"https://api.github.com/users/flamingchickens1540","html_url":"https://github.com/flamingchickens1540","followers_url":"https://api.github.com/users/flamingchickens1540/followers","following_url":"https://api.github.com/users/flamingchickens1540/following{/other_user}","gists_url":"https://api.github.com/users/flamingchickens1540/gists{/gist_id}","starred_url":"https://api.github.com/users/flamingchickens1540/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flamingchickens1540/subscriptions","organizations_url":"https://api.github.com/users/flamingchickens1540/orgs","repos_url":"https://api.github.com/users/flamingchickens1540/repos","events_url":"https://api.github.com/users/flamingchickens1540/events{/privacy}","received_events_url":"https://api.github.com/users/flamingchickens1540/received_events","type":"Organization","site_admin":false},"repo":{"id":25059625,"name":"common-chicken-runtime-engine","full_name":"flamingchickens1540/common-chicken-runtime-engine","owner":{"login":"flamingchickens1540","id":5280254,"avatar_url":"https://avatars.githubusercontent.com/u/5280254?v=3","gravatar_id":"","url":"https://api.github.com/users/flamingchickens1540","html_url":"https://github.com/flamingchickens1540","followers_url":"https://api.github.com/users/flamingchickens1540/followers","following_url":"https://api.github.com/users/flamingchickens1540/following{/other_user}","gists_url":"https://api.github.com/users/flamingchickens1540/gists{/gist_id}","starred_url":"https://api.github.com/users/flamingchickens1540/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flamingchickens1540/subscriptions","organizations_url":"https://api.github.com/users/flamingchickens1540/orgs","repos_url":"https://api.github.com/users/flamingchickens1540/repos","events_url":"https://api.github.com/users/flamingchickens1540/events{/privacy}","received_events_url":"https://api.github.com/users/flamingchickens1540/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine","description":"The CCRE is Team 1540's powerful open-source robot code framework, primarily for FIRST Robotics Competition robots. Click on the Wiki link to the right for more info!","fork":false,"url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine","forks_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/forks","keys_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/teams","hooks_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/hooks","issue_events_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/events{/number}","events_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/events","assignees_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/assignees{/user}","branches_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/branches{/branch}","tags_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/tags","blobs_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/languages","stargazers_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/stargazers","contributors_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/contributors","subscribers_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/subscribers","subscription_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/subscription","commits_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/contents/{+path}","compare_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/merges","archive_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/downloads","issues_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues{/number}","pulls_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/labels{/name}","releases_url":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/releases{/id}","created_at":"2014-10-11T01:51:36Z","updated_at":"2015-11-22T18:33:39Z","pushed_at":"2015-12-13T00:49:33Z","git_url":"git://github.com/flamingchickens1540/common-chicken-runtime-engine.git","ssh_url":"git@github.com:flamingchickens1540/common-chicken-runtime-engine.git","clone_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine.git","svn_url":"https://github.com/flamingchickens1540/common-chicken-runtime-engine","homepage":"","size":27178,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":40,"forks":4,"open_issues":40,"watchers":8,"default_branch":"devel-3.x.x"}},"_links":{"self":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130"},"html":{"href":"https://github.com/flamingchickens1540/common-chicken-runtime-engine/pull/130"},"issue":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/130"},"comments":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/flamingchickens1540/common-chicken-runtime-engine/statuses/f8908d97c4c01f66e47ebfe45780efe9357a3c53"}}}}