Skip to main content

ihub-settings

Henry...About 2 min

ihub-settings

plugin description

ihub-settingsplugin configuration for plugin repository, plugin version, and subproject management, configuration withsettings.gradle.

Plugin IDPlugin NamePlugin TypeExtension Name
pub.ihub.plugin.ihub-settingsConfigure PluginsSettings[^Settings]iHubSettings

Extended Properties

DSL extension support configuration

Extended MethodExtended Description
includeProjectsAdd Items (Support for Multiple Projects)
prefixItem Prefix
noPrefixNo items prefix
suffixProject Suffix
subprojectInclude 3 Level Subprojects
onlySubprojectOnly three tier subprojects (not including the current one, Level 3 arethe main itemsub-item)
skippedDirsIgnore Level 3 Subproject Directory

gradle.propertiesConfigure support properties

PropertyDescription
nameConfigure primary project name
iHubSettings.includeDirsInclude project paths, multiple directories ", " split
iHubSettings.skippedDirsExclude project paths, multiple directories ", " split
iHubSettings.includeBomUsed to configure the bom component, including all subprojects withihub-publishcomponents
iHubSettings.includeLibsPublish catalog component switching,
iHubSettings.includeDependenciesUsed to configure dependencies' components, based on catalog component configuration

Configure the following:

name=demo
iHubSettings.includeDirs=rest,service
iHubSettings.includeBom=ihub-bom

Plugin Installation

Kotlin
plugins {
    id("pub.ihub.plugin.ihub-settings") version "1.6.2"
}

Configuration Example

Configure Subprojects

  • Directory Structure:
+---rest
+---sdk
\---service
  • Configure:
Kotlin
import pub.ihub.plugin.IHubSettingsExtension

configure<IHubSettingsExtension> {
    includeProjects("rest", "sdk", "service")
}

Configure Level 3 Subprojects

  • Directory Structure
+---rest
+---service
+---test
\---other
    +---a
    +---b
    \---c
  • Configure
Kotlin
import pub.ihub.plugin.IHubSettingsExtension

configure<IHubSettingsExtension> {
    includeProjects("rest", "service").suffix("-suffix")
    includeProjects("test").noPrefix
    includeProjects("other").prefix("prefix-").skippedDirs("c").subproject
    includeProjects("subproject").prefix("prefix-").suffix("-suffix").onlySubproject
}

Warning

plugins exclude common non-project directories, build, src, conf, libs, logs, docs, classes, target, out, node_modules, db, gradle

Default Plugin Repositories

Private repository, custom repository configuration seeextension attributes

NameDescriptionUrl
ProjectDirsProject Local Plugin{rootProject.projectDir}/gradle/plugins
MavenLocalLocal Repository{local}/.m2/repository
AliYunGradleAliyun Gradle Agent Repositoryhttps://maven.aliyun.com/repository/gradle-pluginopen in new window
ReleaseRepoPrivate Release Repositoryhttps://repo.xxx.com/releaseopen in new window
SnapshotRepoPrivate Snapshot repositoryhttps://repo.xxx.com/snapshotopen in new window
CustomizeRepoCustom repositoryhttps://repo.xxx.com/repoopen in new window

Default Version

The plugin is configured with ihub series plugins and the following plug-in default versions:

PluginVersion
com.gradle.plugin-publish1.2.0open in new window
pub.ihub.plugin.*1.4.1open in new window
io.freefair.*8.0.1open in new window

Use plugins without plating numbers to configure below:

Kotlin
plugins {
    id("pub.ihub.plugin")
    id("com.gradle.plugin-publish")
}

Configure catalog

  • Configure the default version directory componentsihubLibs
dependencyResolutionManagement {
    repositories {
        mavenCentral()
    }
    versionCatalogs {
        ihubLibs {
            from "pub.ihub.lib:ihub-libs:${IHubLibsVersion.version}"
        }
    }
}
  • Private Snapshot repository
  • gradle/libs.versions.tomlfor standard configurations, gradle will be automatically imported, and this plugin will automatically configure other.versions.tomlfiles such as:myLibs.versions.toml, generally using standard configuration sufficient to configure
  • Private Release Repository