Giter VIP home page Giter VIP logo

Comments (1)

hoshie82 avatar hoshie82 commented on June 26, 2024

Working solution for gradle to download the project in a separate subproject and import it with includeBuild

root project settings.gradle

includeBuild("ext/grid-layout") {
    dependencySubstitution {
        substitute module('com.github.appreciated:vaadin-css-grid') using project(':')
    }
}

grid-layout build.gradle

plugins {
    id 'java'
    id 'org.ajoberstar.grgit' version '5.2.1'
}

// import properties of root project gradle.properties
try {
    Properties props = new Properties()
    props.load(new FileInputStream("$rootDir/../../gradle.properties"))
    props.each { prop -> project.ext.setProperty(prop.key, prop.value) }
} catch (exception) {
    throw new InvalidUserDataException("Parameters not found : $exception.message")
}
repositories {
    mavenCentral()
    maven {
        url "https://vaadin.com/nexus/content/repositories/vaadin-addons/"
    }
}
// dependencies of pom.xml
dependencies {
    implementation "com.vaadin:vaadin:$vaadinVersion"
    implementation "com.vaadin:vaadin-core:$vaadinVersion"
    implementation "org.vaddon:mediaquery:5.0.3"
}

group "com.github.appreciated"
version "3.0.0"

def downloadDir = "$projectDir/build/tmp/"
def generatedClasses = file("$downloadDir/src/main/java")
def generatedResources = file("$downloadDir/src/main/resources")

tasks.register("downloadProject") {
    outputs.dirs downloadDir
    def folder = file(downloadDir)
    doFirst {
        assert folder.exists() || folder.mkdirs()
        grgit.clone(dir: folder, uri: 'https://github.com/appreciated/grid-layout.git')
    }
    onlyIf {
        !folder.exists()
    }
}

sourceSets.main.java.srcDirs += generatedClasses.absolutePath
sourceSets.main.resources.srcDirs += generatedResources.absolutePath
compileJava.dependsOn downloadProject

dependency can be used with

dependencies {
    implementation 'com.github.appreciated:vaadin-css-grid:3.0.0'
}

from grid-layout.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.