Skip to content

Update publishing to new gradle plugin #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Android
Expand All @@ -30,4 +30,4 @@ jobs:
- name: Build GWT
run: ./gradlew :test:html:build
- name: Local install
run: ./gradlew uploadArchives -PLOCAL=true
run: ./gradlew publishToMavenLocal
6 changes: 3 additions & 3 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Android
Expand All @@ -37,4 +37,4 @@ jobs:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run:
./gradlew clean uploadArchives -PRELEASE=true -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
./gradlew clean publish -PRELEASE=true -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
6 changes: 3 additions & 3 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Android
Expand All @@ -31,4 +31,4 @@ jobs:
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew uploadArchives
run: ./gradlew publish
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You also need to add the following file to your GdxDefinition.gwt.xml in your ht
### Building from source
To build from source, clone or download this repository, then open it in Android Studio. Perform the following command to compile and upload the library in your local repository:

gradlew clean uploadArchives -PLOCAL=true
gradlew clean publishToMavenLocal

See `build.gradle` file for current version to use in your dependencies.

Expand Down
90 changes: 0 additions & 90 deletions androidpublish.gradle

This file was deleted.

29 changes: 15 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ buildscript {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "org.wisepersist:gwt-gradle-plugin:1.0.13"
classpath "com.android.tools.build:gradle:4.1.3"
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.19'
classpath "org.docstr:gwt-gradle-plugin:1.1.29"
classpath "com.android.tools.build:gradle:7.2.2"
}
}

Expand All @@ -27,15 +26,6 @@ allprojects {
return project.hasProperty("RELEASE")
}

isLocalBuild = {
return project.hasProperty("LOCAL")
}

getLocalRepositoryUrl = {
return project.hasProperty('LOCAL_REPOSITORY_URL') ? LOCAL_REPOSITORY_URL
: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
}

getReleaseRepositoryUrl = {
return project.hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
Expand Down Expand Up @@ -73,9 +63,20 @@ allprojects {
tasks.withType(Test) {
systemProperty 'file.encoding', 'UTF-8'
}
}

tasks.withType(Sign) {
onlyIf { isReleaseBuild() }
configure(subprojects.findAll {!it.path.contains(":test:") && it.name != 'gdx-controllers-android'}) {
apply plugin: 'java-library'

java {
withSourcesJar()
withJavadocJar()
}
}

apply from: rootProject.file('publish.gradle')

if(rootProject.file('override.gradle').exists())
apply from: rootProject.file('override.gradle')


12 changes: 8 additions & 4 deletions gdx-controllers-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ project.group = 'com.badlogicgames.gdx-controllers'
android {

compileSdkVersion 29
buildToolsVersion '29.0.3'

defaultConfig {
minSdkVersion 16
Expand All @@ -29,6 +28,13 @@ android {
lintOptions {
abortOnError false
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
Expand All @@ -38,6 +44,4 @@ dependencies {

ext {
ARTIFACTID = 'gdx-controllers-android'
}

apply from : '../androidpublish.gradle'
}
11 changes: 0 additions & 11 deletions gdx-controllers-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
apply plugin: 'java-library'

apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-core"
Expand All @@ -17,8 +8,6 @@ dependencies {
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
}

sourceSets.main.java.srcDirs = [ "src/" ]

targetCompatibility = 1.7
sourceCompatibility = 1.7

Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package com.badlogic.gdx.controllers;
/** A base implementation for {@link ControllerListener}. Subclass this if you are only interested in a few specific events.
* @author mzechner */
public class ControllerAdapter implements ControllerListener {
@Override
public boolean buttonDown (Controller controller, int buttonIndex) {
return false;
}
@Override
public boolean buttonUp (Controller controller, int buttonIndex) {
return false;
}
@Override
public boolean axisMoved (Controller controller, int axisIndex, float value) {
return false;
}
@Override
public void connected (Controller controller) {
}
@Override
public void disconnected (Controller controller) {
}
}
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/

package com.badlogic.gdx.controllers;

/** A base implementation for {@link ControllerListener}. Subclass this if you are only interested in a few specific events.
* @author mzechner */
public class ControllerAdapter implements ControllerListener {
@Override
public boolean buttonDown (Controller controller, int buttonIndex) {
return false;
}

@Override
public boolean buttonUp (Controller controller, int buttonIndex) {
return false;
}

@Override
public boolean axisMoved (Controller controller, int axisIndex, float value) {
return false;
}

@Override
public void connected (Controller controller) {
}

@Override
public void disconnected (Controller controller) {
}
}
Loading
Loading