Skip to content

Instantly share code, notes, and snippets.

@jeffque
jeffque / CompilationBuilderSample.java
Created October 3, 2018 04:57
Compilando tudo que contenha `softsite`, porém que não seja o `tc-compiler-help`
CompilationBuilder builder = ...;
builder.setMustCompile(jarPath -> jarPath.matches("^.*softsite.*$") && !jarPath.matches("^.*tc-compiler-help.*$"));
@jeffque
jeffque / CompileApp.java
Created October 3, 2018 05:14
Exemplo completo de compilação do `App`
new CompilationBuilder()
.setKey(tcKey)
.setTotalCrossHome(tcHome)
.setPlatformsTarget(AvailablePlatforms.WIN32)
.setMustCompile(s -> s.contains("totalcross-functional-toolbox"))
.setMainTarget(App.class)
.singlePackage()
.build();
@jeffque
jeffque / CompileApp.java
Last active March 12, 2019 19:31
Criando um `.jar` copiado e compilando-o com TC
package br.com.softsite.streamsupport;
...
import java.io.Closeable;
import java.io.IOException;
import java.util.function.Supplier;
import com.totalcross.util.compile.CompilationBuilder;
@jeffque
jeffque / call-mvn-pkg-n-execjava.sh
Created October 3, 2018 15:30
Linha de comando para chamar o `tc-compiler-help`
mvn clean package exec:java -Dexec.mainClass=br.com.softsite.streamsupport.CompileApp
@jeffque
jeffque / geosales.gitlab-ci.yml
Created October 4, 2018 12:16
Esboço do .gitlab-ci.yml
image: maven:3.3.9-jdk-8
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Xmx2048m -Xms1024m"
MAVEN_CLI_OPTS: "-P gitlab,!dev -DskipDefaultProfile -Dgitlabci -s .m2/settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
stages:
- build-test-nucleo
- build-apps
- archive
@jeffque
jeffque / totalcross-downloader.sh
Last active April 9, 2019 20:38
Script para baixar o TotalCross
#!/bin/bash
detect-version() {
informed_version="$1"
desired_version="$1"
case "$desired_version" in
*-SNAPSHOT)
desired_version=`curl -s https://maven.totalcross.com/artifactory/repo1/com/totalcross/totalcross-sdk/${informed_version}/maven-metadata.xml |
grep value |
head -n1 |
@jeffque
jeffque / url-download-tc.sh
Created October 4, 2018 13:53
Baixando uma versão final
#!/bin/bash
get-major-minor() {
sed -E 's/^([^.*]\.[^.]*)\..*$/\1/' <<<"$1"
}
amazon-tc-url() {
version="$1"
major_minor=`get-major-minor "$version"`
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1.0">
<groupId>com.totalcross</groupId>
<artifactId>totalcross-sdk</artifactId>
<version>4.2.0-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20180924.083450</timestamp>
<buildNumber>13</buildNumber>
</snapshot>
@jeffque
jeffque / guess-tc-snapshot.sh
Created October 4, 2018 15:50
Pegando a versão desejada
#!/bin/bash
curl -s https://maven.totalcross.com/artifactory/repo1/com/totalcross/totalcross-sdk/${informed_version}/maven-metadata.xml |
grep value |
head -n1 |
sed -E 's/^.*>([^<]*)<.*$/\1/'
@jeffque
jeffque / geosales.mobile.gitlab-ci.yml
Created October 4, 2018 15:58
A parte da compilação do mobile
archive-mobile:
<<: *maven-app-template
stage: archive
dependencies:
- build-mobile
cache:
paths:
- totalcross-cache
- .m2/repository
key: tc-download