Skip to content

Build env modernization #2

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 8 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
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
buildscript {
repositories {
mavenCentral()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
classpath 'com.android.tools.build:gradle:8.7.3'
}
}

def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}

allprojects {
version = VERSION_NAME
group = GROUP

repositories {
mavenCentral()
google()
}
}

apply plugin: 'android-reporting'
12 changes: 1 addition & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
VERSION_NAME=1.1.0
GROUP=se.emilsjolander

POM_DESCRIPTION=android-FlipView is an easy to use android library for implementing flipping between views as seen in the popular Flipboard application
POM_URL=https://github.com/emilsjolander/android-FlipView
POM_SCM_URL=https://github.com/emilsjolander/android-FlipView
POM_SCM_CONNECTION=scm:git:git://github.com/emilsjolander/android-FlipView.git
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/emilsjolander/android-FlipView.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=emilsjolander
POM_DEVELOPER_NAME=Emil Sjolander
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Nov 02 21:55:43 CET 2013
#Mon Mar 03 09:05:14 JST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded Gradle to build with the new OpenJDK.
The old OpenJDK does not support Apple Silicon, making development difficult.

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
Empty file modified gradlew
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk17
11 changes: 0 additions & 11 deletions library/AndroidManifest.xml

This file was deleted.

61 changes: 45 additions & 16 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
apply plugin: 'android-library'

repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
plugins {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update build.gradle for modern Android Gradle Plugin.

id 'com.android.library'
id 'maven-publish'
}

android {
compileSdkVersion 18
buildToolsVersion '18.1.1'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
compileSdk 34
namespace 'se.emilsjolander.flipview'

defaultConfig {
minSdk 11
}

buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled false
}
}

publishing {
// Publish as an AAB.
singleVariant('release')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation 'com.android.support:support-v4:18.0.0'
}

apply from: '../maven_push.gradle'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = GROUP
artifactId = 'android-FlipView'
version = VERSION_NAME

afterEvaluate {
from components.release
}
}
}
}
}
Binary file removed library/libs/android-support-v4.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public FlipView(Context context, AttributeSet attrs, int defStyle) {
R.styleable.FlipView);

// 0 is vertical, 1 is horizontal
mIsFlippingVertically = a.getInt(R.styleable.FlipView_orientation,
mIsFlippingVertically = a.getInt(R.styleable.FlipView_android_orientation,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERTICAL_FLIP) == VERTICAL_FLIP;

setOverFlipMode(OverFlipMode.values()[a.getInt(
Expand Down
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move files for modern Android Gradle Plugin.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<resources>

<declare-styleable name="FlipView">
<attr name="orientation" format="enum">
<enum name="vertical" value="0"/>
<enum name="horizontal" value="1"/>
</attr>
<attr name="android:orientation" />
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<attr name="overFlipMode" format="enum">
<enum name="glow" value="0"/>
<enum name="rubber_band" value="1"/>
Expand Down
File renamed without changes.
81 changes: 0 additions & 81 deletions maven_push.gradle

This file was deleted.

42 changes: 27 additions & 15 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
apply plugin: 'android'

repositories {
mavenCentral()
}
dependencies {
compile project(':library')
compile 'com.android.support:support-v4:18.0.0'
plugins {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update build.gradle for modern Android Gradle Plugin.

id 'com.android.application'
}

android {
compileSdkVersion 18
buildToolsVersion '18.0.1'
compileSdk 34
namespace 'se.emilsjolander.flipview.sample'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
defaultConfig {
applicationId 'se.emilsjolander.flipview.sample'
versionCode 1
versionName "1.0"
minSdk 11
}

buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation project(':library')
implementation 'com.android.support:support-v4:18.0.0'
}
Binary file removed sample/libs/android-support-v4.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.emilsjolander.flipview"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="se.emilsjolander.flipview.MainActivity"
android:name="se.emilsjolander.flipview.sample.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package se.emilsjolander.flipview;

import java.util.ArrayList;
import java.util.List;
package se.emilsjolander.flipview.sample;

import android.content.Context;
import android.view.LayoutInflater;
Expand All @@ -12,6 +9,9 @@
import android.widget.Button;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class FlipAdapter extends BaseAdapter implements OnClickListener {

public interface Callback{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package se.emilsjolander.flipview;
package se.emilsjolander.flipview.sample;

import se.emilsjolander.flipview.FlipAdapter.Callback;
import se.emilsjolander.flipview.FlipView.OnFlipListener;
import se.emilsjolander.flipview.FlipView.OnOverFlipListener;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import se.emilsjolander.flipview.sample.FlipAdapter.Callback;
import se.emilsjolander.flipview.FlipView;
import se.emilsjolander.flipview.FlipView.OnFlipListener;
import se.emilsjolander.flipview.FlipView.OnOverFlipListener;
import se.emilsjolander.flipview.OverFlipMode;

public class MainActivity extends Activity implements Callback, OnFlipListener, OnOverFlipListener {

private FlipView mFlipView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:flipview="http://schemas.android.com/apk/res-auto" >
xmlns:tools="http://schemas.android.com/tools">

<se.emilsjolander.flipview.FlipView
android:id="@+id/flip_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
flipview:orientation="vertical"
tools:context=".MainActivity" >
android:orientation="vertical"
tools:context="main.se.emilsjolander.flipview.se.emilsjolander.flipview.sample.MainActivity" >
</se.emilsjolander.flipview.FlipView>

<TextView
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.