Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendordep Templating. #41

Merged
merged 8 commits into from
Dec 3, 2024
26 changes: 13 additions & 13 deletions ExampleVendorJson.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "ExampleVendorJson.json",
"name": "ExampleVendorDep",
"version": "0.0.1",
"version": "${version}",
"frcYear": "2025",
"uuid": "Generate A Unique GUID https://guidgenerator.com/online-guid-generator.aspx and insert it here", This line is to purposely make this fail to parse
"mavenUrls": [
Expand All @@ -10,16 +10,16 @@
"jsonUrl": "InsertSomeUrlHere",
"javaDependencies": [
{
"groupId": "com.vendor.frc",
"artifactId": "Vendor-java",
"version": "0.0.1"
"groupId": "${groupId}",
"artifactId": "${artifactId}-java",
"version": "${version}"
}
],
"jniDependencies": [
{
"groupId": "com.vendor.frc",
"artifactId": "Vendor-driver",
"version": "0.0.1",
"groupId": "${groupId}",
"artifactId": "${artifactId}-driver",
"version": "${version}",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
Expand All @@ -35,9 +35,9 @@
],
"cppDependencies": [
{
"groupId": "com.vendor.frc",
"artifactId": "Vendor-cpp",
"version": "0.0.1",
"groupId": "${groupId}",
"artifactId": "${artifactId}-cpp",
"version": "${version}",
"libName": "Vendor",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand All @@ -53,9 +53,9 @@
]
},
{
"groupId": "com.vendor.frc",
"artifactId": "Vendor-driver",
"version": "0.0.1",
"groupId": "${groupId}",
"artifactId": "${artifactId}-driver",
"version": "${version}",
"libName": "VendorDriver",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand Down
15 changes: 15 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.filters.ReplaceTokens

apply plugin: 'maven-publish'

ext.licenseFile = files("$rootDir/LICENSE.txt")

def templateVendorFile = "ExampleVendorJson.json"

def pubVersion = '0.0.1'

def outputsFolder = file("$buildDir/outputs")
Expand Down Expand Up @@ -156,6 +161,16 @@ publishing {
}
}

// Apply template variables from the vendordep file.
// Replaces ${VARIABLE} with VARIABLE: value in expand()
copy {
from templateVendorFile
into "$releasesRepoUrl/../"
expand( version: pubVersion,
groupId: artifactGroupId,
artifactId: baseArtifactId)
}

thenetworkgrinch marked this conversation as resolved.
Show resolved Hide resolved
thenetworkgrinch marked this conversation as resolved.
Show resolved Hide resolved
task cleanReleaseRepo(type: Delete) {
delete releasesRepoUrl
}
Expand Down