Skip to content

Instantly share code, notes, and snippets.

Avatar

Cédric Champeau melix

View GitHub Profile
@melix
melix / build.gradle
Last active Oct 7, 2022
Dependency downloader
View build.gradle
// 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
melix / GroovyActivity.groovy
Created Apr 24, 2014
An Android activity, written in Groovy, and able to compile and run Groovy code dynamically on the device.
View GroovyActivity.groovy
package me.champeau.groovydroid
import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.view.Menu
import android.view.View
import android.widget.EditText
import com.android.dx.dex.DexFormat
import com.android.dx.dex.DexOptions
@melix
melix / README.md
Last active Mar 14, 2022
Reproducing the benchmarks of the Maven vs Gradle performance page
View README.md

Gradle vs Maven performance reproduction instructions

Install the Gradle Profiler

This page explains how to reproduce the Gradle vs Maven performance numbers yourself. For that, you need to install the Gradle profiler, a tool which will automate benchmarking by running several builds in a row, with the appropriate options (it also runs Maven builds).

Generate the test projects

Our performance comparison uses 4 test projects:

@melix
melix / build.gradle.kts
Last active Dec 21, 2021
Micronaut AOT Intro
View build.gradle.kts
plugins {
id("io.micronaut.application") version "3.1.1"
id("io.micronaut.aot") version "3.1.1"
}
...
micronaut {
...
aot {
version.set("1.0.0-M5")
cacheEnvironment.set(true)
@melix
melix / README.md
Created Dec 20, 2021
Testing Micronaut AOT for Lambda
View README.md

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

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

rootProject.name="micronautguide"

gitRepositories {
@melix
melix / convert.groovy
Created Jul 17, 2013
Convert Confluence HTML export into asciidoc
View convert.groovy
@Grab('net.sourceforge.htmlcleaner:htmlcleaner:2.4')
import org.htmlcleaner.*
def src = new File('html').toPath()
def dst = new File('asciidoc').toPath()
def cleaner = new HtmlCleaner()
def props = cleaner.properties
props.translateSpecialEntities = false
def serializer = new SimpleHtmlSerializer(props)
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
melix / README.adoc
Last active Jul 7, 2021
An automated solver for 2048
View README.adoc

Automated solver for 2048

This is a script which runs a "bot" that tries to solve the incredibly addictive 2048 game. It makes use of Groovy and browser automation with Geb.

How to

  • First step, if you don’t have it, you need to install Groovy.

  • Second step is to install the Google Chrome WebDriver (just unzip the appropriate file to a local directory)

  • Next, edit the script to set the path to the Chrome Driver

  • then execute the script: groovy solver2048.groovy

@melix
melix / Dockerfile
Last active Jun 2, 2020
Dockerfile for Groovy
View Dockerfile
################################################
# Dockerfile to run Groovy containers
# Based on Java 8 image
################################################
FROM java:8u40-jdk
MAINTAINER Cédric Champeau
# Install GVM
@melix
melix / before
Created Mar 27, 2020
New error message
View before
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: