Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Reduce Maven publication size (#3351)

Wouter Born7650a867d1a5
diff --git a/agent/build.gradle b/agent/build.gradle
index 43b1d3ac2..325c2117e 100644
--- a/agent/build.gradle
+++ b/agent/build.gradle
@@ -103,6 +103,8 @@ base {
javadoc {
failOnError = false
+ // Exclude the generated TTN/ChirpStack protobuf classes from Javadoc to reduce the published artifact size
+ source = fileTree('src/main/java')
}
java {
@@ -165,3 +167,8 @@ signing {
sign publishing.publications.maven
}
}
+
+tasks.named('sourcesJar') {
+ // Exclude the generated TTN/ChirpStack protobuf classes from sources to reduce the published artifact size
+ include 'org/openremote/**'
+}
diff --git a/manager/build.gradle b/manager/build.gradle
index 0a9d0ab1c..2b91019d2 100644
--- a/manager/build.gradle
+++ b/manager/build.gradle
@@ -165,7 +165,6 @@ java {
withSourcesJar()
}
-def openApiJsonFile = layout.buildDirectory.file('openapi/openapi.json')
def openApiYamlFile = layout.buildDirectory.file('openapi/openapi.yaml')
publishing {
@@ -175,12 +174,6 @@ publishing {
artifactId = "openremote-${project.name}"
from components.java
- artifact(openApiJsonFile) {
- classifier = 'openapi'
- extension = 'json'
- builtBy tasks.named('resolve')
- }
-
artifact(openApiYamlFile) {
classifier = 'openapi'
extension = 'yaml'
diff --git a/ui/app/insights/build.gradle b/ui/app/insights/build.gradle
index 725c71a57..823e7544a 100644
--- a/ui/app/insights/build.gradle
+++ b/ui/app/insights/build.gradle
@@ -4,7 +4,11 @@ plugins {
id 'signing'
}
-sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
+sourceSets {
+ main {
+ output.dir(layout.buildDirectory.dir("classes/main"), builtBy: "generateSources")
+ }
+}
base {
archivesName = "openremote-${project.name}"
@@ -104,7 +108,5 @@ tasks.register('installDist', Copy) {
clean.dependsOn(cleanDist)
jar.dependsOn(generateSources)
-processResources.dependsOn(generateSources)
-sourcesJar.dependsOn(generateSources)
gradle.startParameter.excludedTaskNames += ["${project.path}:test".toString()]
diff --git a/ui/app/manager/build.gradle b/ui/app/manager/build.gradle
index 810522233..61812c405 100644
--- a/ui/app/manager/build.gradle
+++ b/ui/app/manager/build.gradle
@@ -4,7 +4,11 @@ plugins {
id 'signing'
}
-sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
+sourceSets {
+ main {
+ output.dir(layout.buildDirectory.dir("classes/main"), builtBy: "generateSources")
+ }
+}
base {
archivesName = "openremote-${project.name}"
@@ -110,7 +114,5 @@ tasks.register('installDist', Copy) {
clean.dependsOn(cleanDist)
jar.dependsOn(generateSources)
-processResources.dependsOn(generateSources)
-sourcesJar.dependsOn(generateSources)
gradle.startParameter.excludedTaskNames += ["${project.path}:test".toString()]
diff --git a/ui/app/shared/build.gradle b/ui/app/shared/build.gradle
index 10666df3b..167d0872d 100644
--- a/ui/app/shared/build.gradle
+++ b/ui/app/shared/build.gradle
@@ -8,7 +8,11 @@ plugins {
id 'signing'
}
-sourceSets.main.resources.srcDirs += layout.buildDirectory.dir('classes/main')
+sourceSets {
+ main {
+ output.dir(layout.buildDirectory.dir("classes/main"), builtBy: "generateSources")
+ }
+}
base {
archivesName = "openremote-${project.name}"
@@ -196,7 +200,5 @@ tasks.register('processTranslations', JavaCompile) {
}
jar.dependsOn(generateSources)
-processResources.dependsOn(generateSources)
-sourcesJar.dependsOn(generateSources)
gradle.startParameter.excludedTaskNames += ["${project.path}:test".toString()]
diff --git a/ui/app/storybook/build.gradle b/ui/app/storybook/build.gradle
index 85ae107eb..4c5b230af 100644
--- a/ui/app/storybook/build.gradle
+++ b/ui/app/storybook/build.gradle
@@ -1,74 +1,5 @@
plugins {
- id 'java'
- id 'maven-publish'
- id 'signing'
-}
-
-sourceSets.main.resources.srcDirs += layout.buildDirectory.dir("classes/main")
-
-base {
- archivesName = "openremote-${project.name}"
-}
-
-java {
- withJavadocJar()
- withSourcesJar()
-}
-
-publishing {
- publications {
- maven(MavenPublication) {
- group = "io.openremote.ui"
- artifactId = "openremote-${project.name}"
- from components.java
- pom {
- name = 'OpenRemote Storybook'
- description = 'Provides the Storybook UI for OpenRemote components'
- url = 'https://github.com/openremote/openremote'
- licenses {
- license {
- name = 'GNU Affero General Public License v3.0'
- url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
- }
- }
- developers {
- developer {
- id = 'developers'
- name = 'Developers'
- email = '[email protected]'
- organization = 'OpenRemote'
- organizationUrl = 'https://openremote.io'
- }
- }
- scm {
- connection = 'scm:git:git://github.com/openremote/openremote.git'
- developerConnection = 'scm:git:ssh://github.com:openremote/openremote.git'
- url = 'https://github.com/openremote/openremote/tree/master'
- }
- }
- }
- }
-
- repositories {
- maven {
- if (!version.endsWith('-LOCAL')) {
- credentials {
- username = findProperty("publishUsername")
- password = findProperty("publishPassword")
- }
- }
- url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl")
- }
- }
-}
-
-signing {
- def signingKey = findProperty("signingKey")
- def signingPassword = findProperty("signingPassword")
- if (signingKey && signingPassword) {
- useInMemoryPgpKeys(signingKey, signingPassword)
- sign publishing.publications.maven
- }
+ id 'base'
}
tasks.register('npmBuild', Exec) {
@@ -92,12 +23,6 @@ tasks.register('cleanDist') {
dependsOn npmClean
}
-tasks.register('generateSources', Copy) {
- dependsOn npmBuild
- from layout.buildDirectory.dir("dist")
- into layout.buildDirectory.dir("classes/main/org/openremote/web/${project.name}")
-}
-
tasks.register('prepareUi') {
dependsOn clean, npmPrepare
}
@@ -114,8 +39,3 @@ tasks.register('installDist', Copy) {
}
clean.dependsOn(cleanDist)
-jar.dependsOn(generateSources)
-processResources.dependsOn(generateSources)
-sourcesJar.dependsOn(generateSources)
-
-gradle.startParameter.excludedTaskNames += ["${project.path}:test".toString()]
diff --git a/ui/app/swagger/build.gradle b/ui/app/swagger/build.gradle
index d469d3c19..d3be5df9f 100644
--- a/ui/app/swagger/build.gradle
+++ b/ui/app/swagger/build.gradle
@@ -4,7 +4,11 @@ plugins {
id 'signing'
}
-sourceSets.main.resources.srcDirs += layout.buildDirectory.dir('classes/main')
+sourceSets {
+ main {
+ output.dir(layout.buildDirectory.dir("classes/main"), builtBy: "generateSources")
+ }
+}
configurations {
sources
@@ -112,7 +116,5 @@ tasks.register('installDist', Copy) {
}
jar.dependsOn(generateSources)
-processResources.dependsOn(generateSources)
-sourcesJar.dependsOn(generateSources)
gradle.startParameter.excludedTaskNames += ["${project.path}:test".toString()]
diff --git a/ui/component/core/README.md b/ui/component/core/README.md
index a660eb87c..01da57b9c 100644
--- a/ui/component/core/README.md
+++ b/ui/component/core/README.md
@@ -94,8 +94,7 @@ Various utility methods for common tasks.
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-app/README.md b/ui/component/or-app/README.md
index ed4e7a7d8..2a0c8505a 100644
--- a/ui/component/or-app/README.md
+++ b/ui/component/or-app/README.md
@@ -77,8 +77,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-asset-tree/README.md b/ui/component/or-asset-tree/README.md
index bdca35c40..da2618dd1 100644
--- a/ui/component/or-asset-tree/README.md
+++ b/ui/component/or-asset-tree/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-asset-viewer/README.md b/ui/component/or-asset-viewer/README.md
index d6ee9c961..a4063672e 100644
--- a/ui/component/or-asset-viewer/README.md
+++ b/ui/component/or-asset-viewer/README.md
@@ -77,8 +77,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-attribute-barchart/README.md b/ui/component/or-attribute-barchart/README.md
index da567ba00..f7dc13f2d 100644
--- a/ui/component/or-attribute-barchart/README.md
+++ b/ui/component/or-attribute-barchart/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-attribute-card/README.md b/ui/component/or-attribute-card/README.md
index c072c3849..4b26b0513 100644
--- a/ui/component/or-attribute-card/README.md
+++ b/ui/component/or-attribute-card/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-attribute-history/README.md b/ui/component/or-attribute-history/README.md
index 0c8035ea6..8b9374945 100644
--- a/ui/component/or-attribute-history/README.md
+++ b/ui/component/or-attribute-history/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-attribute-input/README.md b/ui/component/or-attribute-input/README.md
index 7dff868de..39a9f0c28 100644
--- a/ui/component/or-attribute-input/README.md
+++ b/ui/component/or-attribute-input/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-attribute-picker/README.md b/ui/component/or-attribute-picker/README.md
index 202a6119e..3ad0f4db1 100644
--- a/ui/component/or-attribute-picker/README.md
+++ b/ui/component/or-attribute-picker/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-chart/README.md b/ui/component/or-chart/README.md
index f0bae45e8..31ae2a5f6 100644
--- a/ui/component/or-chart/README.md
+++ b/ui/component/or-chart/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-components/README.md b/ui/component/or-components/README.md
index ce6c7a481..90e355dda 100644
--- a/ui/component/or-components/README.md
+++ b/ui/component/or-components/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-icon/README.md b/ui/component/or-icon/README.md
index f3610a5b4..076aa9bbc 100644
--- a/ui/component/or-icon/README.md
+++ b/ui/component/or-icon/README.md
@@ -49,8 +49,7 @@ When an iconset is added then any `or-icon` components in the DOM will be notifi
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-icon/mdi-font-copy.js b/ui/component/or-icon/mdi-font-copy.js
index a0b9154d8..be754cfa6 100644
--- a/ui/component/or-icon/mdi-font-copy.js
+++ b/ui/component/or-icon/mdi-font-copy.js
@@ -20,16 +20,9 @@
const fs = require("fs");
const path = require("path");
-if (!fs.existsSync("build")) {
- fs.mkdirSync("build");
-}
+const packageDir = path.dirname(require.resolve("@mdi/font/package.json"));
+const source = path.join(packageDir, "fonts", "materialdesignicons-webfont.woff2");
+const outputDir = "./build/Material Design Icons/fonts";
-const fontDir = path.join(path.dirname(require.resolve("@mdi/font/package.json")), "fonts");
-const cssDir = path.join(path.dirname(require.resolve("@mdi/font/package.json")), "css");
-
-if (!fs.existsSync("build/Material Design Icons")) {
- fs.mkdirSync("build/Material Design Icons", { recursive: true });
-}
-
-fs.cpSync(fontDir, "./build/Material Design Icons/fonts", { recursive: true });
-fs.cpSync(cssDir, "./build/Material Design Icons/css", { recursive: true });
+fs.mkdirSync(outputDir, { recursive: true });
+fs.copyFileSync(source, path.join(outputDir, "materialdesignicons-webfont.woff2"));
diff --git a/ui/component/or-icon/src/index.ts b/ui/component/or-icon/src/index.ts
index 9bd57a6fe..1e38d2343 100644
--- a/ui/component/or-icon/src/index.ts
+++ b/ui/component/or-icon/src/index.ts
@@ -77,7 +77,6 @@ export function createMdiIconSet(managerUrl: string): IconSet {
},
onAdd(): void {
// Load the material design font from the specified manager shared folder
- // we don't use the MDI css as it contains all the icon CSS which won't be inherited by shadow DOM
const style = document.createElement("style");
style.id = "mdiFontStyle";
style.textContent =
@@ -85,26 +84,11 @@ export function createMdiIconSet(managerUrl: string): IconSet {
' font-family: "Material Design Icons";\n' +
' src: url("' +
managerUrl +
- '/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n' +
- ' src: url("' +
- managerUrl +
- '/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("' +
- managerUrl +
- '/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("' +
- managerUrl +
- '/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("' +
- managerUrl +
- '/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n' +
+ '/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2");\n' +
" font-weight: normal;\n" +
" font-style: normal;\n" +
"}";
document.head.appendChild(style);
-
- // const styleElem = document.createElement("link") as HTMLLinkElement;
- // styleElem.type = "text/css";
- // styleElem.rel = "stylesheet";
- // styleElem.href = managerUrl + "/shared/fonts/Material Design Icons/css/materialdesignicons.min.css";
- // document.head.appendChild(styleElem);
},
};
}
diff --git a/ui/component/or-log-viewer/README.md b/ui/component/or-log-viewer/README.md
index db19594fd..549ac1ca8 100644
--- a/ui/component/or-log-viewer/README.md
+++ b/ui/component/or-log-viewer/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-map/README.md b/ui/component/or-map/README.md
index 1a0fd6ce0..e2ed1296b 100644
--- a/ui/component/or-map/README.md
+++ b/ui/component/or-map/README.md
@@ -99,8 +99,7 @@ The following DOM events may be fired by the component and markers:
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-mwc-components/README.md b/ui/component/or-mwc-components/README.md
index 30341795a..e86a9f027 100644
--- a/ui/component/or-mwc-components/README.md
+++ b/ui/component/or-mwc-components/README.md
@@ -18,8 +18,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-rules/README.md b/ui/component/or-rules/README.md
index d44d1f5b9..c5c81902d 100644
--- a/ui/component/or-rules/README.md
+++ b/ui/component/or-rules/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-scheduler/README.md b/ui/component/or-scheduler/README.md
index c76379914..3affe5b5c 100644
--- a/ui/component/or-scheduler/README.md
+++ b/ui/component/or-scheduler/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-services/README.md b/ui/component/or-services/README.md
index 5c01966fb..412ea9460 100644
--- a/ui/component/or-services/README.md
+++ b/ui/component/or-services/README.md
@@ -17,8 +17,7 @@ For a full list of properties, methods and options refer to the TypeDoc generate
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/or-translate/README.md b/ui/component/or-translate/README.md
index 195a922da..48f759632 100644
--- a/ui/component/or-translate/README.md
+++ b/ui/component/or-translate/README.md
@@ -53,8 +53,7 @@ required. For usage example see the [or-translate source code](./src/index.ts).
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/component/rest/README.md b/ui/component/rest/README.md
index a659e0c1c..b7c49292d 100644
--- a/ui/component/rest/README.md
+++ b/ui/component/rest/README.md
@@ -59,8 +59,7 @@ rest.initialise();
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License
diff --git a/ui/demo/demo-core/README.md b/ui/demo/demo-core/README.md
index 053a9e0e6..8fcaed684 100644
--- a/ui/demo/demo-core/README.md
+++ b/ui/demo/demo-core/README.md
@@ -5,7 +5,7 @@ To run the demo you must have a running OpenRemote Manager backend with Demo ass
## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge.
## License