Skip to content

Instantly share code, notes, and snippets.

View melix's full-sized avatar

Cédric Champeau melix

View GitHub Profile
melix / build.gradle
Last active October 7, 2022 17:09
Dependency downloader
// Downloads dependencies of an artifact in an output directory
// Note that it assumes _runtime_ dependencies, and it assumes "Maven compatible" variants.
// For compile time (API) dependencies, or for variant-aware resolution,
// code would have to be updated to set the appropriate resolution attributes.
// Usage:
// gradle download --input org.apache.groovy:groovy-json:4.0.1
// Optional flags:
melix /
Created December 20, 2021 17:49
Testing Micronaut AOT for Lambda

Edit your settings.gradle file to include the Micronaut Gradle Plugin branch:

plugins {
    id 'me.champeau.includegit' version '0.1.4'

gitRepositories {
melix / build.gradle.kts
Last active December 21, 2021 16:21
Micronaut AOT Intro
plugins {
id("io.micronaut.application") version "3.1.1"
id("io.micronaut.aot") version "3.1.1"
micronaut {
aot {
<?xml version="1.0" encoding="UTF-8"?>
Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
Subject to the condition set forth below, permission is hereby granted to any
person obtaining a copy of this software, associated documentation and/or
data (collectively the "Software"), free of charge and under any and all
melix / before
Created March 27, 2020 15:35
New error message
Unable to find a matching variant of project :platform:
- Variant 'apiElements' capability org.test:platform:1.9:
- Incompatible attribute:
- Required org.gradle.category 'library' and found incompatible value 'platform'.
- Other attributes:
- Required org.gradle.dependency.bundling 'external' but no value provided.
- Required org.gradle.jvm.version '8' but no value provided.
- Required org.gradle.libraryelements 'classes' but no value provided.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Variant 'enforcedApiElements' capability org.test:platform-derived-enforced-platform:1.9:
melix / build.gradle
Last active January 12, 2020 00:47
Publish an additional fat jar with Gradle
plugins {
id 'java-library'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'maven-publish'
group = 'com.acme'
version = '1.0.0'
repositories {
melix / verification-metadata.xml
Created December 21, 2019 18:19
8 seconds to generate this file
<?xml version="1.0" encoding="UTF-8"?>
<ignored-key id="da8a5ec02d11ead" reason="Key couldn't be downloaded from any key server"/>
<ignored-key id="374cf2e8dd1bdfd" reason="Key couldn't be downloaded from any key server"/>
<ignored-key id="97586cfea37f9a6" reason="Key couldn't be downloaded from any key server"/>
<ignored-key id="d3b328562a119a7" reason="Key couldn't be downloaded from any key server"/>
class PropertiesWriter extends DefaultTask {
final Property<String> key ="someProperty")
final Property<String> value ="someValue")
final Provider<RegularFile> outputFile = project.layout.buildDirectory.file("")
import java.util.*
open class PropertiesWriter : DefaultTask() {
val key =<String>().convention("someProperty")
val value =<String>().convention("someValue")
* This file was generated by the Gradle 'init' task.
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at
import java.util.*
open class PropertiesWriter : DefaultTask() {