{"id":16168683,"url":"https://github.com/jacibrunning/embeddedtools","last_synced_at":"2025-03-18T23:31:00.353Z","repository":{"id":55522021,"uuid":"101078622","full_name":"JaciBrunning/EmbeddedTools","owner":"JaciBrunning","description":"Additions to the model-based DSL for deploying Java and Native projects to remote targets","archived":false,"fork":false,"pushed_at":"2021-01-31T03:04:30.000Z","size":671,"stargazers_count":11,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T13:18:04.997Z","etag":null,"topics":["deploy","embedded","gradle","java","native","remote","target","tools"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaciBrunning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-22T15:30:02.000Z","updated_at":"2024-09-09T19:26:49.000Z","dependencies_parsed_at":"2022-08-15T02:20:33.373Z","dependency_job_id":null,"html_url":"https://github.com/JaciBrunning/EmbeddedTools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaciBrunning%2FEmbeddedTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaciBrunning%2FEmbeddedTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaciBrunning%2FEmbeddedTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaciBrunning%2FEmbeddedTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaciBrunning","download_url":"https://codeload.github.com/JaciBrunning/EmbeddedTools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955750,"owners_count":20374373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy","embedded","gradle","java","native","remote","target","tools"],"created_at":"2024-10-10T03:12:55.956Z","updated_at":"2025-03-18T23:30:59.906Z","avatar_url":"https://github.com/JaciBrunning.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"EmbeddedTools\r\n====\r\nCompile and Deploy for Embedded Targets in both Java and C++.\r\n\r\nEmbeddedTools adds compiler and library rules to make writing native software easier.\r\nFor all projects, you can define deployment targets and artifacts. The deploy process works over SSH/SFTP and\r\nis extremely quick.\r\n\r\nCommands:\r\n`gradlew deploy` will deploy all artifacts\r\n`gradlew deploy\u003cartifact name\u003e\u003ctarget name\u003e` will deploy only the specified artifact to the specified target\r\n\r\nProperties:\r\n`gradlew deploy -Pdeploy-dirty` will skip the cache check and force redeployment of all files\r\n`gradlew deploy -Pdeploy-dry` will do a 'dry run' (will not connect or deploy to target, instead only printing to console)\r\n\r\n## Installing plugin\r\nInclude the following in your `build.gradle`\r\n```gradle\r\nplugins {\r\n    id \"jaci.gradle.EmbeddedTools\" version \"\u003clatest version\u003e\"\r\n}\r\n```\r\n\r\nSee [https://plugins.gradle.org/plugin/jaci.gradle.EmbeddedTools](https://plugins.gradle.org/plugin/jaci.gradle.EmbeddedTools) for the latest version\r\n\r\n## Spec\r\n\r\n```gradle\r\nimport jaci.gradle.toolchains.*\r\nimport jaci.gradle.nativedeps.*\r\n\r\n// DSL (all properties optional unless stated as required)\r\ndeploy {\r\n    targets {\r\n        target('myTarget') {\r\n            directory = '/home/myuser'  // The root directory to start deploying to. Default: user home\r\n            maxChannels = 1         // The number of channels to open on the target (how many files / commands to run at the same time). Default: 1\r\n            timeout = 3             // Timeout to use when connecting to target. Default: 3 (seconds)\r\n            failOnMissing = true    // Should the build fail if the target can't be found? Default: true\r\n\r\n            locations {\r\n                ssh {\r\n                    address = \"mytarget.local\"  // Required. The address to try\r\n                    user = 'myuser'             // Required. The user to login as\r\n                    password = ''               // The password for the user. Default: blank (empty) string\r\n                    ipv6 = false                // Are IPv6 addresses permitted? Default: false\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    artifacts {\r\n        // COMMON PROPERTIES FOR ALL ARTIFACTS //\r\n        all {\r\n            directory = 'mydir'                     // Subdirectory to use. Relative to target directory\r\n            targets \u003c\u003c 'myTarget'                   // Targets to deploy to\r\n\r\n            onlyIf = { execute('echo Hi').result == 'Hi' }   // Check closure for artifact. Will not deploy if evaluates to false\r\n\r\n            predeploy \u003c\u003c { execute 'echo Pre' }      // After onlyIf, but before deploy logic\r\n            postdeploy \u003c\u003c { execute 'echo Post' }    // After this artifact's deploy logic\r\n\r\n            disabled = true                         // Disable this artifact. Default: false.\r\n\r\n            dependsOn('someTask')                   // Make this artifact depend on a task\r\n        }\r\n        // END COMMON //\r\n\r\n        fileArtifact('myFileArtifact') {\r\n            file = file('myFile')               // Set the file to deploy. Required.\r\n            filename = 'myFile.dat'             // Set the filename to deploy to. Default: same name as file\r\n        }\r\n\r\n        // FileCollectionArtifact is a flat collection of files - directory structure is not preserved\r\n        fileCollectionArtifact('myFileCollectionArtifact') {\r\n            files = fileTree(dir: 'myDir')      // Required. Set the filecollection (e.g. filetree, files, etc) to deploy\r\n        }\r\n\r\n        // FileTreeArtifact is like a FileCollectionArtifact, but the directory structure is preserved\r\n        fileTreeArtifact('myFileTreeArtifact') {\r\n            files = fileTree(dir: 'mydir')      // Required. Set the fileTree (e.g. filetree, ziptree) to deploy\r\n        }\r\n\r\n        commandArtifact('myCommandArtifact') {\r\n            command = 'echo Hello'              // The command to run. Required.\r\n            // Output will be stored in 'result' after execution\r\n        }\r\n\r\n        // JavaArtifact inherits from FileArtifact\r\n        javaArtifact('myJavaArtifact') {\r\n            jar = 'jar'                         // The jar (or Jar task) to deploy. Default: 'jar'\r\n            // Note: This artifact will automatically depend on the jar build task\r\n        }\r\n\r\n        // NativeArtifact inherits from FileArtifact\r\n        nativeArtifact('myNativeArtifact') {\r\n            component = 'my_program'            // Required. The name of the native component (model.components {}) to deploy.\r\n            targetPlatform = 'desktop'          // The name of the native platform (model.platforms {}) to deploy.\r\n\r\n            // Note: This artifact will automatically depend on the native component link task\r\n        }\r\n\r\n        // NativeLibraryArtifact inherits from FileCollectionArtifact\r\n        nativeLibraryArtifact('myNativeLibraryArtifact') {\r\n            library = 'mylib'                   // Required. Name of library (model.libraries {}) to deploy.\r\n            targetPlatform = 'desktop'          // The name of the native platform (model.platforms {}) to deploy.\r\n            flavor = 'myFlavor'                 // The name of the flavor (model.flavors {}) to deploy.\r\n            buildType = 'myBuildType'           // The name of the buildType (model.buildTypes {}) to deploy.\r\n        }\r\n    }\r\n}\r\n\r\nmodel {\r\n    libraries {\r\n        // COMMON PROPERTIES FOR ALL LIBRARIES //\r\n        all {\r\n            libraryName = 'myactuallib'     // The name to give this library in useLibrary and when referencing from other places.\r\n            targetPlatform = 'desktop'      // The name of the native platform (model.platforms {}) this lib is built for\r\n            targetPlatforms = ['desktop1', 'desktop2']  // Same as targetPlatform, but for multiple platforms.\r\n            flavor = 'myFlavor'             // The name of the flavor (model.flavors {}) this lib is for\r\n            buildType = 'myBuildType'       // The name of the buildType (model.buildTypes {}) this lib is for\r\n        }\r\n        // END COMMON\r\n\r\n        mylib(NativeLib) {\r\n            headerDirs \u003c\u003c 'include'                         // Directories for headers\r\n            sourceDirs \u003c\u003c 'sources'                         // Directories for sources\r\n            staticMatchers \u003c\u003c '**/*.a'                      // Static Libraries to be linked at compile time\r\n            sharedMatchers \u003c\u003c '**/*.so'                     // Shared Libraries to be linked at compile time\r\n            dynamicMatchers \u003c\u003c '**/*.so'                    // Libraries that aren't linked, but still needed at runtime.\r\n            systemLibs \u003c\u003c 'm'                               // System libs to load with -l (provided by toolchain)\r\n\r\n            maven = \"some.maven.package:mylib:1.0.0@zip\"    // Load from maven. Must be a zip or zip-compatible (like a jar)\r\n            file = project.file(\"mylib.zip\")                // Load from filesystem instead. Can be given a zip or a directory.\r\n        }\r\n\r\n        // You can create a collection of libraries using CombinedNativeLib\r\n        myComboLib(CombinedNativeLib) {\r\n            libs \u003c\u003c 'myactuallib' \u003c\u003c 'someotherlib'\r\n        }\r\n    }\r\n\r\n    components {\r\n        my_program(NativeExecutableSpec) {\r\n            embeddedTools.useLibrary(it, \"myComboLib\")\r\n        }\r\n    }\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacibrunning%2Fembeddedtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacibrunning%2Fembeddedtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacibrunning%2Fembeddedtools/lists"}